π€ Gemma 2B Fine-tuned A fine-tuned version of google/gemma-2b trained using Supervised Fine-Tuning (SFT) with the TRL library. The model is quantized to 4-bit using bitsandbytes for efficient inference.
π Quick Start pythonfrom transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig import torch
model_id = "abhishekyadav16/gemma-2b-finetuned"
4-bit quantization config
bnb_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.float16, )
tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, quantization_config=bnb_config, device_map="auto", )
Inference
prompt = "What is machine learning?" inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad(): outputs = model.generate( **inputs, max_new_tokens=200, temperature=0.7, do_sample=True, pad_token_id=tokenizer.eos_token_id, )
response = tokenizer.decode(outputs[0], skip_special_tokens=True) print(response)
ποΈ Training Details ParameterValueBase Modelgoogle/gemma-2bFine-tuning MethodSFT (Supervised Fine-Tuning)LibraryTRL + TransformersQuantization4-bit (bitsandbytes)Parameters~1.1BHardwareGoogle Colab (T4 GPU)FrameworkPyTorch
π¦ Model Architecture
Architecture: Gemma (LlamaForCausalLM-based) Parameters: 1,116.3M (~1.1B) Context Length: 8192 tokens Quantization: NF4 4-bit via bitsandbytes
π‘ Use Cases
Conversational AI / Chatbot Text generation and completion Question answering Instruction following
β οΈ Limitations
This model is fine-tuned for research and learning purposes. May produce incorrect or biased outputs β not recommended for production use without further evaluation. Performance is limited by the base Gemma 2B capacity.
π¨βπ» Author Abhishek Yadav β AI Engineer | LLMs Β· RAG Β· Agentic AI Β· MCP
π Portfolio: 3-d-portfolio.vercel.app πΌ LinkedIn: abhishek-yadav72 π GitHub: CodeBy-Abhishek π€ HuggingFace: abhishekyadav16
π License This model is released under the Gemma License. Please review Google's terms before commercial use.
- Downloads last month
- 67
Model tree for abhishekyadav16/gemma-2b-finetuned
Base model
google/gemma-2b