nebula-st-twi-en
Version 0.2.1 (git tag v0.2.1 in this repo; pin it as
nebula-st-twi-en@0.2.1).
Speech translation model: Twi audio → English text. Frozen-mostly
Whisper (openai/whisper-small) encoder (top 4 layers trainable)
feeding a small transformer decoder (d_model=256, 4
layers, 8 heads) trained from scratch. No language-conditioning heads
(LID/DANN/language embedding) — this is a plain baseline model.
Part of nebula-research.
Citation
If you use this model in your work, please cite it, the version you used, and the datasets it was trained on (see Built from):
@software{nebula-st-twi-en-0.2.1,
author = {Acquaye, Frank Lawrence Nii Adoquaye and
Ansahene, Joe-Bosworth and
{AdwumaTech AI}},
title = {{nebula-st-twi-en}: Twi-to-English Speech
Translation (Nebula)},
version = {0.2.1},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/adwumatech-ai/nebula-st-twi-en/tree/v0.2.1}
}
Training data
Training hours not published for this version: the run's processed training set wasn't kept, so its hours can't be recomputed (about 19,800 segments per epoch; see Training). Whisper, for reference, trained on 680,000 hours.
Trained only on shards explicitly approved in
dataset_registry.yaml:
Source dataset: adwumatech-ai/mghana-st. This model's weights are released under CC BY 4.0 to match the training data's license — attribute both this model and the mghana-st dataset if you use it.
Splits
splits/train.txt, splits/val.txt and splits/test.txt list every audio
file of the approved shards (<shard>/<audio_id>, one per line) by the split
preprocess.py assigns it: md5(f"{audio_id}_42") with 10 % validation and
10 % test (its defaults). The split depends on the audio_id alone, so every
segment of a file, and every annotator's translation of it, is in one split,
whichever shards or fraction a training run downloaded. With those defaults
(the run's exact command wasn't recorded), this model was trained only on
files in train.txt. splits/README.md has the rule.
Files: 22,001 train, 2,677 validation, 2,733 test.
Overlap between test and train (splits/leak_report.json). FISD speakers
read prompts, so the same sentence and the same voices recur across files:
- test speakers who also speak in train: 362 of 362
- test prompts (dialect + prompt id) also read in train: 264 of 264
- test files whose translation also translates a train file: 2,480 of 2,733
So a test-split score measures reproduction on seen sentences and seen voices, not generalisation to new speech.
Training
| Seed | 42 |
| Batch size | 16 |
| Optimiser | AdamW, learning rate 0.0005, 500 warm-up steps, gradient clip 1.0 |
| Epochs scheduled | 60 |
| Dropout | 0.1 |
| Whisper layers fine-tuned | top 4 of the encoder |
| Decoder | 4 layers, d_model 256, 8 heads, feed-forward 1024 |
| Checkpoint | epoch 15 (best validation BLEU so far) |
| Optimiser steps | 18,600 (1,240 batches per epoch) |
| Validation loss at this epoch | 1.242 |
| Validation BLEU tracked during training | 58.3 (50 sampled validation clips, greedy; not a full-split score) |
| Weights | the same as version 0.2.0 |
| Code | not recorded; scripts/train.py, dataset.py, preprocess.py and config.yaml were identical from 7e0dc9d (2026-08-07) through cdc4da7, the HEAD when this run started on 2026-10-28 |
Built from
| Component | What it contributes | Licence |
|---|---|---|
openai/whisper-small | Pretrained speech encoder (fine-tuned here) and tokenizer | MIT |
| Financial Inclusion Speech Dataset (Asamoah Owusu et al., 2022) | The Twi audio | CC BY 4.0 |
| MGhana-ST translations | The English translations | CC BY 4.0 |
Not used: UGSpeechData. MGhana-ST also draws on UGSpeechData (Wiafe et al., 2025, doi:10.57760/sciencedb.22298). No UGSpeechData audio or text was used to train or evaluate this model, and none of it is in the shards listed above.
If you use this model, cite MGhana-ST and the Financial Inclusion Speech Dataset, which supplied the audio this model was trained on:
@dataset{acquaye2025mghana,
author = {Acquaye, Frank Lawrence Nii Adoquaye, Jesse Jojo Johnson et al. 2025},
title = {{MGhana-ST}: A Speech Translation Dataset for
Ghanaian Languages},
year = {2025},
publisher = {AdwumaTech AI},
url = {https://huggingface.co/datasets/adwumatech-ai/mghana-st}
}
@misc{owusu2022financial,
author = {Asamoah Owusu, Dennis and Korsah, Ayorkor and
Quartey, Benjamin and Nwolley Jnr., Seth and
Sampah, Daniel and Adjepon-Yamoah, David and
Omane Boateng, Lawrence},
title = {Financial Inclusion Speech Dataset},
year = {2022},
note = {Ashesi University and Nokwary Technologies,
funded by Lacuna Fund},
url = {https://github.com/Ashesi-Org/Financial-Inclusion-Speech-Dataset}
}
Evaluation
Test-split scores for this version are held back until JusRunAm publishes its quality targets (nebula-research#7). On-device parity on 264 test-split segments (greedy), against PyTorch at the same encoder window: fp32 identical at 30, 20 and 10 s. int8 within the written-down tolerance (BLEU and chrF drop at most 1.0) at 30 s (BLEU -0.42, chrF +0.34 drop) and 20 s (int8 scored 1.37 BLEU / 1.36 chrF higher); at 10 s int8 misses the BLEU tolerance (1.25 BLEU drop, chrF 0.35). For int8 on phones, use the 20 s or 30 s window; for 10 s, use fp32.
Full run history: nebula-research-results Space.
Usage
This is a custom PyTorch architecture, not a standard transformers model.
The repo holds:
| File | What it is |
|---|---|
model.safetensors | Weights (no pickle) |
config.json | Architecture, embedded Whisper encoder config, tokenizer settings |
tokenizer/ | Whisper tokenizer + feature extractor files |
manifest.json | Name, version, languages and a SHA-256 for every file |
model.py, tokenizer.py, language_utils.py, inference.py, export_model.py, mobile_model.py, mobile_adapters.py | The training repo's code to load it |
Loading needs no other download: the Whisper encoder is built from
config.json, and the hashes in manifest.json are checked first.
import sys
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="adwumatech-ai/nebula-st-twi-en", revision="v0.2.1")
sys.path.insert(0, model_dir) # the loading code ships in the repo
from inference import load_exported_model, audio_to_text
model, tok = load_exported_model(model_dir, device="cpu")
waveform, sample_rate = ... # load your own audio, shape [channels, samples]
print(audio_to_text(model, tok, waveform, sample_rate))
Or use the hosted demo/API: nebula-st-demo Space.
On-device (ExecuTorch)
Encoder and decoder-step programs for phones, run with
ExecuTorch on its XNNPACK backend.
Each folder's config.json gives the input and output shapes, the
ExecuTorch version they were built with and the kernel libraries the
app must link (int8 also needs the quantized kernels library).
| Folder | What | Download (encoder + decoder) | Peak memory, desktop proxy |
|---|---|---|---|
mobile/fp32/ | full precision; the same outputs as the PyTorch model | 361 + 123 MB | 872 MB |
mobile/int8/ | int8 weights (dynamic quantization) | 99 + 36 MB | 538 MB |
The app computes Whisper's 80-bin log-mel of each 30-second window, runs
encoder.pte once on it (or on its first F frames, a shorter window: F even,
100 to 3000, 100 per second; the encoder is most of the time on a phone),
then calls decoder_step.pte with the tokens so far
(the start token first) and appends the most likely next token until the
end token. mobile_model.py has the same loop in Python
(load_executorch, greedy_decode). Peak memory is one window plus 40
decoder steps in ExecuTorch's Python runtime on x86; phones differ.
Adapters for on-device training
For federated training (JusRunAm), each folder also has
decoder_step_lora.pte (translate with LoRA adapters given as inputs) and
decoder_train.pte (returns the loss on one correction; its trainable
parameters are zero-started deltas, which are the phone's update).
mobile/adapters.safetensors holds the round-0 adapters, which leave the
output unchanged. Only the decoder's adapters train; everything else is
frozen. config.json → adapters lists the input order and shapes;
mobile_adapters.py has the same programs in PyTorch and DP-FedAvg.
Limitations
- Only covers the language(s) listed above — see
dataset_registry.yamlfor what's approved and why others aren't yet. - No cascaded ASR baseline exists for comparison: Whisper does not support ASR for Ga, Twi, Ewe, or Fante, so there's no way to compare against a transcribe-then-translate pipeline for this language.
- Trained on a research-scale dataset; expect rough edges outside the training distribution (background noise, unusual speaking styles, etc).