nebula-st-whisper-twi-en
Version 0.2.0 (git tag v0.2.0; pin as nebula-st-whisper-twi-en@0.2.0). Engine: nebula-st-whisper.
Twi (Akan) speech → English text. openai/whisper-small
fine-tuned end-to-end for speech translation: the bottom 8 encoder layers, the convolutional front end and the
embeddings are frozen; the top 4 encoder layers and the whole pretrained decoder are trained. Decoding starts
from the fixed prefix <|startoftranscript|><|translate|><|notimestamps|> (no language token).
Training data
MGhana-ST Twi shards.
YouTube recordings. The model was also trained on data from YouTube, with human English translations. These recordings are not part of MGhana-ST or any other public dataset yet.
The MGhana-ST splits are by prompt template: no validation or test prompt appears in training. Three recordings are held out of training entirely.
Evaluation
scripts/eval.py, beam search (size 4), multi-reference corpus BLEU / chrF (sacrebleu):
| Split | BLEU | chrF | Segments | What it measures |
|---|---|---|---|---|
| test | 7.11 | 17.65 | 1925 | MGhana-ST test split: prompt templates never seen in training |
| val | 13.87 | 24.42 | 931 | MGhana-ST validation split: prompt templates never seen in training |
| YouTube recordings | 5.55 | 26.25 | 1147 | 3 held-out YouTube recordings never seen in training |
These are honest scores on sentences the model never trained on. Expect partly right translations of short everyday phrases.
Usage
import sys
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="adwumatech-ai/nebula-st-whisper-twi-en", revision="v0.2.0")
sys.path.insert(0, model_dir) # whisper_st.py ships in the repo
import whisper_st
model, tok, fe = whisper_st.load_model(model_dir) # checks manifest.json's SHA-256s first
print(whisper_st.translate_waveform(model, tok, fe, whisper_st.load_audio("clip.wav"), beam_size=4))
Or from a shell: python whisper_st.py translate --model <model_dir> clip.wav. Long audio is split into
30-second windows.
On-device (ExecuTorch)
mobile/<precision>/ holds XNNPACK programs: encoder.pte (mel → cross-attention keys/values, once per
30 s window) and decoder_step.pte (tokens → next-token logits; start from decoding.prefix_ids in its
config.json). For on-device training, decoder_step_lora.pte and decoder_train.pte take LoRA
adapters (rank 8, every decoder linear layer) as inputs and train zero-initialised deltas;
mobile/adapters.safetensors holds the round-0 adapters. Each config.json documents the inputs.
| Precision | Download (encoder + decoder) | Training programs (LoRA step + train) | Peak memory, desktop | BLEU / chrF drop vs PyTorch | Identical outputs |
|---|---|---|---|---|---|
| int8 | 109.2 + 182.4 MB | 182.6 + 143.1 MB | 1003 MB | -0.04 / -0.01 | 80.0 % |
| int8-vocab18k | 109.2 + 130.8 MB | 131.0 + 117.4 MB | 978 MB | -0.04 / -0.15 | 80.0 % |
| fp32 | 409.4 + 717.6 MB | 717.8 + 559.2 MB | 1790 MB | 0.0 / 0.0 | 100.0 % |
Parity: greedy decoding of 100 test-split files, mobile programs vs PyTorch.
int8-vocab18k is the same model with its output vocabulary trimmed to the 18,561 of Whisper's 51,865 tokens that this model can produce (the most common tokens, every token in the training translations and the 256 byte tokens), which makes the decoder smaller. Its token ids are indices into kept_ids in mobile/int8-vocab18k/vocab.json: map each id the programs return through that list before detokenizing with the Whisper tokenizer, and map training targets the other way. Its prefix and end-of-text ids in config.json are already mapped.
Built from
| Component | Licence |
|---|---|
openai/whisper-small (weights, tokenizer) | Apache 2.0 |
| MGhana-ST (translations; see the dataset card for its audio sources and citations) | CC BY 4.0 |
| Recordings from YouTube, with human translations | Not specified |
Licence
These weights use CC BY 4.0, but also adhere to the license of what it's built on: Whisper-small is Apache 2.0 and MGhana-ST is CC BY 4.0, but the YouTube recordings used in training have no stated licence. Ask the maintainers before using it commercially or redistributing it.
Limitations
- Twi (Akuapem, Asante) only.
- Weak on long-form speech.
- A 242M-parameter model: the int8 phone download is roughly 290 MB (240 MB for
int8-vocab18k).