Views
No views yet
| Source | Pairs |
|---|---|
| Synthetic (from rule JSONs) | 959 |
| law.stackexchange.com | 2,805 |
| SEC EDGAR (employment contracts) | 202 |
| CourtListener API (case law) | 1,119 |
| Court self-help guides | 111 |
| Parameter | Value |
|---|---|
| Base model | unsloth/gemma-4-E4B-it-unsloth-bnb-4bit |
| Method | QLoRA |
| Rank (r) | 16 |
| Alpha | 32 |
| Dropout | 0.0 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Quantization | 4-bit (NF4 via Unsloth) |
| Seq length | 1024 |
| Epochs | 3 |
| Steps | 927 |
| Batch size | 1 (grad accum 16, effective batch 16) |
| Learning rate | 2e-4 (cosine decay) |
| Optimizer | adamw_8bit |
| GPU | Kaggle T4 (15.6GB, sm_75, fp16) |
| Training time | 5h 18m |
| Cost | $0 |
1from peft import PeftModel
2from transformers import AutoTokenizer, AutoModelForCausalLM
3import torch
4
5base_model = "google/gemma-4-E4B-it"
6adapter = "israelburns/jeremy-gemma4"
7
8tokenizer = AutoTokenizer.from_pretrained(base_model)
9model = AutoModelForCausalLM.from_pretrained(
10 base_model,
11 torch_dtype=torch.float16,
12 device_map="auto"
13)
14model = PeftModel.from_pretrained(model, adapter)
15
16messages = [
17 {"role": "system", "content": "You are Jeremy, a legal procedural guidance AI for the Pro Se Network. You help self-represented litigants understand legal procedures. You are NOT a lawyer. Procedural guidance only, never legal advice. Always include a disclaimer."},
18 {"role": "user", "content": "I was served with a lawsuit in New York. I have 20 days to respond. What do I do?"}
19]
20
21inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
22outputs = model.generate(inputs, max_new_tokens=512)
23print(tokenizer.decode(outputs[0], skip_special_tokens=True))