sabi-yoruba-llm
An English↔Yoruba translation layer built for SABI, a private, fully offline AI coworker that runs a 3B code/chat model on a standard 8 GB laptop. SABI's core model is English-only, so Yoruba turns are translated to English, answered normally, then translated back — with fenced code blocks always left untouched, so code explained in Yoruba is still real, runnable code.
This repo is facebook/nllb-200-distilled-600M
converted once, offline, to an int8-quantized CTranslate2 model, so it
runs fast on CPU with no GPU and no torch at inference time — only
ctranslate2 and a tokenizer.
Usage
pip install ctranslate2 transformers
import ctranslate2
import transformers
translator = ctranslate2.Translator("sabi-yoruba-llm", device="cpu")
tokenizer = transformers.AutoTokenizer.from_pretrained("sabi-yoruba-llm")
tokenizer.src_lang = "eng_Latn"
tokens = tokenizer.convert_ids_to_tokens(tokenizer.encode("Hello, how are you?"))
results = translator.translate_batch(
[tokens], target_prefix=[["yor_Latn"]]
)
translated = tokenizer.decode(
tokenizer.convert_tokens_to_ids(results[0].hypotheses[0][1:])
)
print(translated)
Swap target_prefix to ["eng_Latn"] (with tokenizer.src_lang = "yor_Latn")
to translate Yoruba back to English.
In SABI
SABI wires this model into sabi/translate.py and downloads/converts it via
scripts/download_yoruba_model.py in the main
SABI repository. Set SABI_LANGUAGE=yo (or reply in
Yoruba) to use it. See SABI's REPORT.md §11 for verified before/after
examples.
License
The base model, facebook/nllb-200-distilled-600M, is released by Meta under CC-BY-NC-4.0 (non-commercial). This converted copy carries the same license and restriction — non-commercial use only. All credit for the underlying model to Meta AI's NLLB team.
- Downloads last month
- 21
Model tree for Doctorgp1/sabi-yoruba-llm
Base model
facebook/nllb-200-distilled-600M