πŸ€– 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
Safetensors
Model size
1B params
Tensor type
F32
Β·
BF16
Β·
U8
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for abhishekyadav16/gemma-2b-finetuned

Base model

google/gemma-2b
Quantized
(35)
this model