A 30M-parameter Luganda chat model: Kintu-2.0-30M, further fine-tuned on multi-turn Luganda chats and then preference-tuned with DPO. The architecture and tokenizer are unchanged.
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("henryhale/Kintu-2.0-30M-Instruct")
model = AutoModelForCausalLM.from_pretrained("henryhale/Kintu-2.0-30M-Instruct")
messages = [
{"role": "system", "content": "Oli muyambi ow'amagezi ayamba abantu mu Luganda."},
{"role": "user", "content": "Oli otya?"},
]
enc = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt", return_dict=True)
out = model.generate(**enc, max_new_tokens=256, do_sample=True, temperature=0.4, top_p=0.8, repetition_penalty=1.2)
print(tok.decode(out[0, enc["input_ids"].shape[1]:], skip_special_tokens=True))
At 30M parameters it often drifts off-topic and gets facts wrong, so don't rely on it for information, especially on health, money or farming. The fine-tuning data is mostly AI-written and machine-translated, and hasn't been fully reviewed by native speakers. Keep chats short: it saw at most 512 tokens at a time.
model.safetensors 120 MBtraining_args.bin 5.8 kBhenryhale/Kintu-2.0-30M