Instructions to use TarunNagaSai007/gemma4-e2b-pokemon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use TarunNagaSai007/gemma4-e2b-pokemon with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-E2B-it") model = PeftModel.from_pretrained(base_model, "TarunNagaSai007/gemma4-e2b-pokemon") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use TarunNagaSai007/gemma4-e2b-pokemon with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TarunNagaSai007/gemma4-e2b-pokemon to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for TarunNagaSai007/gemma4-e2b-pokemon to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for TarunNagaSai007/gemma4-e2b-pokemon to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="TarunNagaSai007/gemma4-e2b-pokemon", max_seq_length=2048, )
Gemma 4 E2B — Pokémon Pokédex (LoRA Adapter)
LoRA adapter fine-tuned on google/gemma-4-e2b-it to answer Pokémon questions across three task types: stat lookups, full Pokédex profiles, and battle-outcome reasoning with chain-of-thought.
Model Details
- Base model: google/gemma-4-e2b-it
- Method: LoRA (16-bit), trained with Unsloth
- Trainable params: ~31M (0.60% of base)
- LoRA config: r=16, alpha=16, dropout=0, targets q/k/v/o/gate/up/down projections
Tasks
| Task | Input example | Output |
|---|---|---|
| Stat | "What is the Speed of Duskull?" | 25 |
| Profile | "Tell me about Miltank." | Full Pokédex entry (type, stats, abilities, evolution, dex text) |
| Battle | "If Raichu battles Blastoise, who wins?" | <think> reasoning block + verdict |
Usage
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="TarunNagaSai007/gemma4-e2b-pokemon",
max_seq_length=2048,
load_in_4bit=False,
)
FastLanguageModel.for_inference(model)
messages = [
{"role": "system", "content": [{"type": "text", "text": "You are a Pokédex assistant. Answer questions about Pokémon stats, profiles, and battle outcomes accurately."}]},
{"role": "user", "content": [{"type": "text", "text": "If Charizard battles Venusaur, who wins?"}]},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
out = model.generate(input_ids=inputs, max_new_tokens=512, temperature=0.3)
print(tokenizer.decode(out[0], skip_special_tokens=True))
Training
- Dataset: ~8,600 instruction examples (stat / profile / battle), 957 validation, 1,200 test
- Epochs: 3 | Effective batch: 8 | LR: 2e-4 cosine, 100 warmup steps
- Optimizer: adamw_8bit | Hardware: single T4 (Colab)
- Final validation loss: 0.164
Data Training Report
Training loss and Validation loss compraistion
Comparesation results between base model and Fine-tuned model
Limitations
Trained on a fixed Pokédex snapshot; stats and profiles reflect that data. Battle reasoning uses a simplified type/offense/speed heuristic, not full damage-calc mechanics. Built for educational/hobby use.
- Downloads last month
- 1