gemma2racer is a specialized optimization of Google's Gemma 2 architecture. This model is fine-tuned and configured specifically for "racing" performance—prioritizing high-speed token generation and low-memory overhead for local LLM deployment.| Feature | Details |
|---|---|
| Developed by | Rabimba Karanjai |
| Model Type | Causal Language Model (Transformer-based) |
| Base Model | google/gemma-2-2b |
| Architecture | Gemma-2 |
| Optimization Strategy | 4-bit Quantization, torch.compile, and BitsAndBytes |
| Primary Language | English |
| License | Gemma Terms of Use |
pip install -U transformers accelerate bitsandbyteshuggingface-cli login1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "rabimba/gemma2racer"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 load_in_4bit=True,
11 torch_dtype=torch.bfloat16
12)
13
14prompt = "Explain quantum physics like I'm a race car driver."
15inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
16
17outputs = model.generate(**inputs, max_new_tokens=150)
18print(tokenizer.decode(outputs[0], skip_special_tokens=True))model = torch.compile(model) to utilize kernel fusion for significantly higher throughput.accelerate for systems with limited or no dedicated graphics memory.1@misc{gemma2racer2024,
2 author = {Rabimba Karanjai},
3 title = {Gemma-2-Racer: Optimized Local Inference},
4 year = {2024},
5 publisher = {Hugging Face},
6 howpublished = {\url{https://huggingface.co/rabimba/gemma2racer}}
7}