Views
No views yet
unsloth/gemma-4-12b-it,
supervised-fine-tuned on the coding slice of a Claude Opus 4.6/4.7 reasoning dataset to
sharpen step-by-step coding and reasoning responses. Trained with Unslothunsloth/gemma-4-12b-itcoding was used), nor for
non-English use, safety-critical decisions, or factual lookup. Outputs can be confidently wrong —
review generated code before running it. Subject to the Gemma license and prohibited-use policy.1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3from peft import PeftModel
4
5base_id = "unsloth/gemma-4-12b-it"
6adapter_id = "pranavms13/gemma-4-12b-opus-4.7-distilled-lora" # this folder / your HF repo id
7
8tok = AutoTokenizer.from_pretrained(base_id)
9model = AutoModelForCausalLM.from_pretrained(base_id, torch_dtype=torch.bfloat16, device_map="auto")
10model = PeftModel.from_pretrained(model, adapter_id)
11
12messages = [{"role": "user", "content": "Write a Python function that returns the nth Fibonacci number iteratively."}]
13inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
14out = model.generate(inputs, max_new_tokens=512)
15print(tok.decode(out[0], skip_special_tokens=True))1from unsloth import FastModel
2model, tok = FastModel.from_pretrained("pranavms13/gemma-4-12b-opus-4.7-distilled-lora", max_seq_length=8192, load_in_16bit=True)angrygiraffe/claude-opus-4.6-4.7-reasoning-8.7k,
OpenAI-style chat JSONL (messages + category + model), filtered to category == "coding" →
9,768 examples. Formatted with the Gemma 4 chat template; trained on assistant responses only
(prompt tokens masked from the loss).| Training regime | bf16 (16-bit LoRA, no QLoRA) |
LoRA rank r / alpha | 16 / 16 |
| LoRA dropout / bias | 0.0 / none |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Max sequence length | 8192 |
| Per-device batch size | 2 |
| Gradient accumulation | 4 (effective batch = 8) |
| Learning rate | 2e-4, linear schedule, 5 warmup steps |
| Epochs | 2 (2,442 steps) |
| Optimizer | adamw_torch_fused |
| Weight decay | 0.01 |
| Seed | 3407 |
adapter_model.safetensors).SFTTrainer), Transformers, PEFT 0.19.1, PyTorch (NVIDIA NGC container).expandable_segments:True to avoid OOM on unified memory.