faster-whisper-51-african-languages
CTranslate2 (float16) conversion of
Sunbird/SunflowerASR-51-african-languages — Whisper large-v3
fine-tuned for ASR in 51 African languages — for use with
faster-whisper.
Converted from source revision
9177ad6c.
A different compute_type (e.g. int8_float16, ~1.6 GB VRAM) can be selected
at load time and is quantized on the fly.
IMPORTANT: language codes
The fine-tune reuses Whisper's built-in language-token slots for African
languages, and faster-whisper only accepts standard Whisper language codes.
To transcribe a given language, pass the faster-whisper code from the
table below (also machine-readable in
language_map.json). Do not rely on automatic
language detection.
| Language | Sunbird code | pass to faster-whisper as language= |
|---|---|---|
| Acholi | ach | su |
| Afrikaans | afr | af |
| Akan | aka | jw |
| Amharic | amh | am |
| Ateso | teo | bs |
| Bambara | bam | ba |
| Bemba | bem | haw |
| Berber | ber | tt |
| Chichewa | nya | km |
| Dagaare | dga | bo |
| Dagbani | dag | tl |
| English | eng | en |
| Ewe | ewe | my |
| French | fra | fr |
| Fulani | ful | lb |
| Hausa | hau | ha |
| Igbo | ibo | sa |
| Ikposo | kpo | uz |
| Kabyle | kab | mt |
| Kalenjin | kln | ht |
| Kanuri | kau | nn |
| Kikuyu | kik | tk |
| Kinyarwanda | kin | ps |
| Kwamba | rwm | sq |
| Lendu | led | lo |
| Lingala | lin | ln |
| Luganda | lug | sd |
| Lugbara | lgg | yi |
| Luhya | luy | be |
| Lumasaba | myx | ka |
| Luo | luo | tg |
| Lusoga | xog | eu |
| Malagasy | mlg | mg |
| Ndebele | nbl | oc |
| Nigerian Pidgin | pcm | mr |
| Oromo | orm | pa |
| Rukiga | cgg | as |
| Rukonjo | koo | fo |
| Runyankole | nyn | si |
| Ruruuli | ruc | gl |
| Rutooro | ttj | ne |
| Shona | sna | sn |
| Somali | som | so |
| Sotho | sot | kk |
| Swahili | swa | sw |
| Thur | lth | gu |
| Tswana | tsn | mn |
| Wolof | wol | hy |
| Xhosa | xho | is |
| Yoruba | yor | yo |
| Zulu | zul | br |
Usage
import json
from faster_whisper import WhisperModel
from huggingface_hub import hf_hub_download
repo = "Sunbird/faster-whisper-51-african-languages"
lang_map = json.load(open(hf_hub_download(repo, "language_map.json")))
model = WhisperModel(repo, device="cuda", compute_type="float16")
segments, info = model.transcribe(
"audio.wav",
language=lang_map["lug"], # Luganda
task="transcribe",
beam_size=5,
vad_filter=True,
condition_on_previous_text=False,
)
for segment in segments:
print(f"[{segment.start:.2f} -> {segment.end:.2f}] {segment.text}")
Notes
- The source repo's reference pipeline normalizes input features
(
do_normalize=TrueinWhisperProcessor); faster-whisper's feature extractor does not apply this normalization. Validate WER on your target languages against the Transformers baseline before production use. - See the base model card for training data, per-language WER/CER, and evaluation methodology.