Instructions to use TarunNagaSai007/gemma4-e2b-pokemon-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TarunNagaSai007/gemma4-e2b-pokemon-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TarunNagaSai007/gemma4-e2b-pokemon-merged") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("TarunNagaSai007/gemma4-e2b-pokemon-merged") model = AutoModelForMultimodalLM.from_pretrained("TarunNagaSai007/gemma4-e2b-pokemon-merged", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TarunNagaSai007/gemma4-e2b-pokemon-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TarunNagaSai007/gemma4-e2b-pokemon-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TarunNagaSai007/gemma4-e2b-pokemon-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TarunNagaSai007/gemma4-e2b-pokemon-merged
- SGLang
How to use TarunNagaSai007/gemma4-e2b-pokemon-merged with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "TarunNagaSai007/gemma4-e2b-pokemon-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TarunNagaSai007/gemma4-e2b-pokemon-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "TarunNagaSai007/gemma4-e2b-pokemon-merged" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TarunNagaSai007/gemma4-e2b-pokemon-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use TarunNagaSai007/gemma4-e2b-pokemon-merged with Docker Model Runner:
docker model run hf.co/TarunNagaSai007/gemma4-e2b-pokemon-merged
Gemma 4 E2B — Pokémon Pokédex (Merged 16-bit)
Standalone merged model: google/gemma-4-e2b-it fine-tuned on Pokémon data with the LoRA adapter folded into the base weights. No separate adapter needed — load and run directly. For the lightweight adapter version, see TarunNagaSai007/gemma4-e2b-pokemon.
Model Details
- Base model: google/gemma-4-e2b-it
- Method: LoRA fine-tune merged to 16-bit, via Unsloth
- Format: Full safetensors (~9.5GB), fp16
Tasks
| Task | Input example | Output |
|---|---|---|
| Stat | "What is the Speed of Duskull?" | 25 |
| Profile | "Tell me about Miltank." | Full Pokédex entry |
| Battle | "If Raichu battles Blastoise, who wins?" | <think> reasoning + verdict |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"TarunNagaSai007/gemma4-e2b-pokemon-merged",
torch_dtype=torch.float16, device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("TarunNagaSai007/gemma4-e2b-pokemon-merged")
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": "What is the Speed of Pikachu?"}]},
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(**{"input_ids": inputs}, max_new_tokens=256)
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
- Optimizer: adamw_8bit | Hardware: single T4 (Colab)
- Final validation loss: 0.164
Conversion to GGUF
This merged model can be converted to GGUF for Ollama / llama.cpp. Use the Gemma 4 chat template when running.
Limitations
Trained on a fixed Pokédex snapshot. Battle reasoning uses a simplified type/offense/speed heuristic, not full damage mechanics. Educational/hobby use.
- Downloads last month
- 18