Instructions to use burkimbia/BIA-MISTRAL-7B-SACHI_4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use burkimbia/BIA-MISTRAL-7B-SACHI_4bit with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "translation" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("translation", model="burkimbia/BIA-MISTRAL-7B-SACHI_4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("burkimbia/BIA-MISTRAL-7B-SACHI_4bit") model = AutoModelForCausalLM.from_pretrained("burkimbia/BIA-MISTRAL-7B-SACHI_4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Desktop
BIA-MISTRAL-7B-SACHI (bitsandbytes 4-bit)
French ↔ Mooré translation model from BurkimbIA,
a non-profit association in Ouagadougou building NLP tools for the languages of
Burkina Faso. Mooré (ISO 639-3 mos) is spoken by roughly 8 million people and
has very little digital text, which shapes every design choice here.
This is the 4-bit checkpoint: the one to run with transformers on a small
GPU. For a server, use
_merged instead.
Which repository do I want?
The SaChi Mistral fine-tune is published three times, from the same training run:
| Repository | Contents | Use it for |
|---|---|---|
BIA-MISTRAL-7B-SACHI |
LoRA adapter (~100 MB) | applying the fine-tune on top of your own base copy |
BIA-MISTRAL-7B-SACHI_merged |
full weights, bf16, 14.5 GB | vLLM, TGI, any fp16/bf16 server |
BIA-MISTRAL-7B-SACHI_4bit (this repo) |
full weights, bitsandbytes 4-bit, 7.2 GB | transformers on a 12 GB GPU |
This repository and _merged are two saves of the same run, five hours apart:
every tokenizer file is byte-identical between them, only config.json differs
by the quantization_config block bitsandbytes adds.
Do not serve this repository with vLLM. vLLM handles pre-quantized
bitsandbytes checkpoints poorly; use _merged and let the server manage memory
itself.
Access
This repository is gated: request access above, then pass an approved token
to whatever loads it (HF_TOKEN in the environment, token= for
from_pretrained). Without it the download fails with 401 Unauthorized on
config.json.
Prompt format
The model was fine-tuned on a raw completion prompt, not on a chat template.
Do not wrap it in apply_chat_template. Use this exact string:
<s>
You are an expert Moore translator. Translate the provided {SRC} text to {TGT}.
The Moore alphabet is: a, ã, b, d, e, ẽ, ɛ, f, g, h, i, ĩ, ɩ, k, l, m, n, o, õ, p, r, s, t, u, ũ, ʋ, v, w, y, z.
Based on source language ({SRC}), provide the {TGT} text.
[INST]
### {SRC}:
{TEXT}
[/INST]
### {TGT}:
{SRC} and {TGT} are the English words French and Moore, in either
direction. The leading blank line and the <s> are part of the training format;
keep them.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "burkimbia/BIA-MISTRAL-7B-SACHI_4bit"
tok = AutoTokenizer.from_pretrained(repo)
tok.padding_side, tok.pad_token = "left", tok.eos_token
model = AutoModelForCausalLM.from_pretrained(repo, device_map="auto") # quantization is in config.json
PROMPT = """
<s>
You are an expert Moore translator. Translate the provided {src} text to {tgt}.
The Moore alphabet is: a, ã, b, d, e, ẽ, ɛ, f, g, h, i, ĩ, ɩ, k, l, m, n, o, õ, p, r, s, t, u, ũ, ʋ, v, w, y, z.
Based on source language ({src}), provide the {tgt} text.
[INST]
### {src}:
{text}
[/INST]
### {tgt}:
"""
def translate(texts, src="French", tgt="Moore", max_new_tokens=256):
if isinstance(texts, str):
texts = [texts]
prompts = [PROMPT.format(src=src, tgt=tgt, text=t) for t in texts]
inputs = tok(prompts, padding=True, truncation=True, max_length=1024, return_tensors="pt").to(model.device)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=max_new_tokens, do_sample=False)
gen = out[:, inputs.input_ids.shape[1]:]
return [t.strip() for t in tok.batch_decode(gen, skip_special_tokens=True)]
print(translate("Le marché est fermé aujourd'hui."))
Decoding: do_sample=False. The model is a translator, not a chat assistant,
and sampling only adds noise. bitsandbytes must be installed.
Reverse direction: translate("Raagã pagame rũndã.", src="Moore", tgt="French").
Hardware
| Precision | Weights | Minimum GPU |
|---|---|---|
| 4-bit (this repo) | 7.2 GB | 12 GB |
bf16 (_merged) |
14.5 GB | 24 GB |
Related models
burkimbia/BIA-NLLB-600M-11E— much smaller seq2seq translator, better latency, lower quality on long sentencesburkimbia/BIA-WHISPER-LARGE-SACHI_V2— Mooré speech recognitionburkimbia/BIA-SPARKTTS-V4— Mooré text to speech
Benchmark and leaderboard: burkimbia/mt-benchmark-public,
scored on BLEU, METEOR and chrF across five themes (administrative, daily life,
health, religious, arts and technology).
Limitations
- Low-resource. Mooré has little digital text. Output can be disfluent or wrong, and degrades on long, technical or out-of-domain sentences.
- Tone is not written in Mooré orthography, so homographs are frequent and the model can pick the wrong sense.
- 4-bit quantization costs some quality against the bf16 weights, and is noticeably slower to generate despite the smaller footprint.
- The model follows the prompt above closely; changing its wording, the
alphabet line or the
### Moore:marker changes the output quality. - Outputs should be reviewed by a Mooré speaker before any consequential use, in particular for administrative, legal or medical content.
Citation
@misc{burkimbia_sachi_mistral,
title = {BIA-MISTRAL-7B-SACHI: French-Moore translation},
author = {BurkimbIA},
year = {2025},
url = {https://huggingface.co/burkimbia/BIA-MISTRAL-7B-SACHI_4bit}
}
- Downloads last month
- -
Model tree for burkimbia/BIA-MISTRAL-7B-SACHI_4bit
Base model
unsloth/mistral-7b-bnb-4bit