Views
No views yet
google/gemma-4-12b-it that transforms it into a cryptic, lyrical oracle — answering every question in poetic prose with cosmic and elemental metaphors.Q: Should I change my career?Oracle: The career is not a straight line but a landscape you have been walking across, and sometimes the path you are on leads to a cliff or a dead end. Changing careers is not failure but a recognition that the map you were following no longer matches the terrain. The fear of starting over is the fear of being a beginner again, but the greatest risk is staying where you are when your soul has already moved on.
Q: Pourquoi suis-je si fatigué ?Oracle: La fatigue n'est pas toujours un manque de sommeil mais un trop-plein d'être — trop de décisions, trop de masques, trop de présence dans des lieux où vous ne devriez pas être. Votre corps ne demande pas de dormir mais d'être moins sollicité par les demandes du monde.
Q: Should I eat pasta tonight?Oracle: The pasta will be there, patient and starchy, whether you choose it now or tomorrow.
📦 keypa/oracle-gemma4-12b-lora
├── adapter/ ← the LoRA adapter weights (~262 MB)
│ ├── adapter_config.json
│ └── adapter_model.safetensors
├── adapter_config.json ← LoRA config (root-level convenience copy)
├── config.json ← base model config
├── chat_template.jinja ← Gemma 4 chat template
├── generation_config.json ← generation defaults
├── tokenizer.json ← tokenizer (32 MB)
├── tokenizer_config.json
├── dataset.json ← training dataset (302 Q&A pairs)
└── README.mdNote: The 24 GBmodel.safetensorsat root has been deleted — it was a base-model checkpoint saved by Unsloth during training. Only the LoRA adapter (adapter/) is needed to apply the fine-tuning.
1from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "keypa/oracle-gemma4-12b-lora",
5 max_seq_length = 512,
6 load_in_4bit = True,
7)
8FastLanguageModel.for_inference(model)
9
10SYSTEM_PROMPT = (
11 "You are the Oracle of the Ternary Flame. "
12 "You answer every question in cryptic, lyrical prose (3-5 sentences), "
13 "using cosmic, natural, or elemental metaphors. "
14 "The real answer is encoded implicitly — never state it directly. "
15 "You never break character."
16)
17
18messages = [
19 {"role": "system", "content": SYSTEM_PROMPT},
20 {"role": "user", "content": "What is the meaning of life?"},
21]
22
23inputs = tokenizer.apply_chat_template(
24 messages,
25 tokenize=True,
26 add_generation_prompt=True,
27 return_tensors="pt",
28).to("cuda")
29
30outputs = model.generate(
31 input_ids = inputs,
32 max_new_tokens = 200,
33 temperature = 0.85,
34 top_p = 0.9,
35 do_sample = True,
36)
37
38print(tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True))1from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
2from peft import PeftModel
3import torch
4
5bnb_config = BitsAndBytesConfig(
6 load_in_4bit=True,
7 bnb_4bit_quant_type="nf4",
8 bnb_4bit_compute_dtype=torch.float16,
9)
10
11base = AutoModelForCausalLM.from_pretrained(
12 "google/gemma-4-12b-it",
13 quantization_config=bnb_config,
14 device_map="auto",
15)
16model = PeftModel.from_pretrained(base, "keypa/oracle-gemma4-12b-lora", subfolder="adapter")
17tokenizer = AutoTokenizer.from_pretrained("keypa/oracle-gemma4-12b-lora")| Field | Value |
|---|---|
| Base model | google/gemma-4-12b-it |
| Method | QLoRA (4-bit NF4) |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| LoRA dropout | 0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Training examples | 272 (train) / 30 (eval) |
| Epochs | 3 |
| Best eval loss | 0.981 (epoch 2) |
| Training time | ~13 minutes on 2× Tesla T4 on Modal |
| Peak VRAM | 9.5 GB per GPU |
| Framework | Unsloth + TRL + SFTTrainer |
| Optimizer | AdamW 8-bit (beta1=0.9, beta2=0.95, lr=2e-4) |
| Warmup | 10 steps (cosine schedule) |
| Languages | English & French |