Views
No views yet
Qwen/Qwen2.5-1.5B-Instruct on the Balanda language (also called Njo Viri), spoken by the Balanda people of South Sudan and the Democratic Republic of the Congo. Njo Viri is an undocumented language with no prior presence on the HuggingFace Hub.| Task | Test N | chrF++ | BLEU |
|---|---|---|---|
| Balanda → English | 267 | 92.9 | 86.3 |
| English → Balanda | 5 | 22.9 | 8.6 |
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
3from peft import PeftModel
4
5ADAPTER = "wujang/qwen2_5_1_5b_balanda_qlora"
6BASE = "Qwen/Qwen2.5-1.5B-Instruct"
7
8bnb = BitsAndBytesConfig(
9 load_in_4bit=True,
10 bnb_4bit_quant_type="nf4",
11 bnb_4bit_use_double_quant=True,
12 bnb_4bit_compute_dtype=torch.float16,
13)
14
15tok = AutoTokenizer.from_pretrained(ADAPTER)
16base = AutoModelForCausalLM.from_pretrained(BASE, quantization_config=bnb, device_map="auto")
17model = PeftModel.from_pretrained(base, ADAPTER).eval()
18
19messages = [
20 {"role": "system", "content": "You are a Balanda (Njo Viri) language expert. Follow the user's instruction precisely."},
21 {"role": "user", "content": "Translate from Balanda to English\n\nNi timande kee ni ja nja gba."},
22]
23prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
24inputs = tok(prompt, return_tensors="pt").to(model.device)
25out = model.generate(**inputs, max_new_tokens=128, do_sample=False)
26print(tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True).strip())
27# → "He works but does not eat."SFTTrainer with chat-template formatting| Epoch | Train loss | Val loss |
|---|---|---|
| 1 | 0.433 | 0.478 |
| 2 | 0.336 | 0.412 |
| 3 | 0.292 | 0.412 |
@misc{ujang2026njoviri,
author = {Ujang, Jamson Batista Ulau},
title = {Njo Viri (Balanda) instruction-tuning dataset and QLoRA adapter},
year = {2026},
howpublished = {\url{https://huggingface.co/wujang/qwen2_5_1_5b_balanda_qlora}},
}