Downloads · 30 days
17.6K
38% of all-time downloads
Sedibaai/SedibaLM
SedibaLM is a text generation model from Sedibaai. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
A Sepedi (Sesotho sa Leboa) language model, fine-tuned from Qwen2.5-1.5B-Instruct with QLoRA by Sediba AI NPC.
Downloads · 30 days
17.6K
38% of all-time downloads
All-time downloads
46.8K
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
A Sepedi (Sesotho sa Leboa) language model, fine-tuned from Qwen2.5-1.5B-Instruct with QLoRA by Sediba AI NPC.
Sepedi is spoken by roughly 4.7 million people in South Africa and is severely under-represented in language models. V7 is the first validated model in the SedibaLM lineage.
V7 is a ChatML-format SFT model. Prompted with raw text it emits EOS immediately and returns an empty string. This is the single most common way to conclude "the model is broken" when it is not.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "Sedibaai/SedibaLM"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float32)
model.eval()
# ✅ CORRECT — wrap the prompt in the chat template
messages = [{"role": "user", "content": "Ngwala ka bohlokwa bja thuto ka Sepedi."}]
text = tokenizer.apply_chat_template(
messages, tokenize=False, add_generation_prompt=True
)
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
out = model.generate(
**inputs,
max_new_tokens=128,
temperature=0.7,
top_p=0.8,
repetition_penalty=1.3, # recommended; prevents degenerate loops
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
# decode ONLY the new tokens — do not slice by prompt string length
print(tokenizer.decode(out[0][inputs.input_ids.shape[-1]:], skip_special_tokens=True))
# ❌ WRONG — returns "" (immediate EOS)
inputs = tokenizer("Ngwala ka bohlokwa bja thuto ka Sepedi.", return_tensors="pt")
Two further gotchas we hit ourselves:
out[0][inputs.input_ids.shape[-1]:]). Slicing decoded text by len(prompt) breaks once the input is a chat-templated wrapper.chat_template.jinja is not auto-loaded — read the file and pass it to apply_chat_template(chat_template=...).Given Sepedi input, the base Qwen2.5-1.5B-Instruct refuses in English and misidentifies the language:
"I apologize for any misunderstanding but I don't have enough context to provide an accurate translation… The text appears to be written using the Sesotho sa Leboa language (also known as Setswana), which is spoken primarily in South Africa among people from Botswana's northern region…"
That is wrong on two counts: Sesotho sa Leboa is Sepedi, and it is not Setswana from northern Botswana.
V7, same input, answers in Sepedi:
Tumalanong ye ke gore re tla dira dilo ka mokgwa wa temothuo gomme ra fediša ditlamorago tše di sa kgahlišego kudu mo nageng ya gaborena.
The achievement is that V7 treats Sepedi as a language it speaks, rather than a foreign artefact to apologise about.
Held-out slice of 1,109 Sepedi-only records (filtered by function-word density), n=50, 80 max new tokens, identical prompts and harness for both runs.
| Metric | Base Qwen2.5-1.5B | SedibaLM V7 | Ratio |
|---|---|---|---|
| chrF (continuation-only) | 0.1869 | 0.2202 | 1.18× |
| Monolinguality | 0.0646 | 0.1934 | 2.99× |
| No-repetition | 1.0000 | 1.0000 | — |
| Composite SCORE | 0.3128 | 0.3681 | 1.18× |
SCORE = 0.5·chrF + 0.3·monolinguality + 0.2·no_repetition
These are comparative figures for ranking checkpoints. They are not absolute quality claims, and we would rather say so than let them be over-read:
š ŋ ñ ê ô à ë ü) or matches a digraph list (kg ny tl dl sw rw ph kh tsh th sh ngw). Perfectly ordinary Sepedi words with neither feature score as ambiguous, not as Sepedi. Fully-Sepedi output still lands in the 0.15–0.19 band. Read the 2.99× gap, not the absolute value.| Base model | Qwen2.5-1.5B-Instruct |
| Parameters | 1.54B |
| Method | QLoRA → merged to full weights |
| LoRA rank / alpha | r=16, α=32, dropout 0.05 |
| Target modules | q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_proj |
| Format | ChatML SFT |
| Training records | 184,979 (v7_corpus_clean_v2_train.jsonl) |
| Epochs | 3 (69,369 optimizer steps) |
| Sequence length | 1024 tokens |
| Training precision | bf16 |
| Tokenizer / vocab | stock Qwen2.5, 151,665 |
| Adapter size | 73.9 MB (md5 04ee2da1…) |
| This repo | merged full model, ~3.0 GB |
Training loss fell 6.39 → 1.92.
Note on vocabulary. A 400-subword Sepedi tokenizer extension (vocab 152,065) was designed for this lineage but was not consumed by this run — V7 is stock 151,665. If you see 152,065 quoted anywhere, that is design intent for a future V8, not this model. Also note Qwen2.5's embedding matrix is padded to 151,936, which is larger than the vocab by design; do not call
resize_token_embeddingsto "fix" it.
Sepedi conversational AI; community information delivery; low-resource language modelling research; demonstrating sovereign African AI capability.
Medical, legal, or financial advice. Safety-critical or real-time systems. Languages other than Sepedi.
Model weights: CC BY-SA 4.0. Attribution to Sediba AI NPC and contributing communities; derivatives share alike.
The training data is not released under this licence. Corpus material is governed separately by NOODL (Northern-Sotho Open Data Licence, in legal review) — the open-weights layer and the restricted-data layer are deliberately distinct.
Community-contributed data was gathered under FPIC (Free, Prior and Informed Consent) principles. The Kutullo Exchange royalty mechanism is designed so contributing communities share in downstream value. Do not use this model to generate content that misleads or harms Sepedi-speaking communities.
@misc{sedibalm-v7-2026,
title = {SedibaLM V7: A Sepedi (Sesotho sa Leboa) Language Model Fine-Tuned with QLoRA},
author = {Sediba AI NPC},
year = {2026},
url = {https://huggingface.co/Sedibaai/SedibaLM}
}
Built by Sediba AI NPC — sovereign AI for South African languages. Sepedi first, then the remaining official languages of South Africa, then the wider Global South.