Moonshine-Tiny Hausa (OpenBible Fine-Tune)
This repository provides fine-tuned weights, an expanded tokenizer vocabulary for African hooked orthography, and evaluation benchmarks for UsefulSensors/moonshine-tiny (~27M parameters) adapted to Hausa (ha).
The model extends Moonshine's automatic speech recognition capabilities to Hausa, anchoring phonetic alignment, hooked consonant distinctions (ɓ, ɗ, ƙ, ƴ), and continuous sentence structure from high-fidelity, studio-recorded multilingual-tts/open-bible Hausa speech (~30,600 audio segments).
Benchmark Performance (Unseen Test Set)
Evaluated across 100 hold-out test samples from unseen speakers/chapters using beam search (num_beams=4, repetition_penalty=1.3, no_repeat_ngram_size=3):
| Evaluation Metric | Raw / Verbatim | Clean / Standardized Speech |
|---|---|---|
| Word Error Rate (WER) | 36.88% | 27.09% |
| Character Error Rate (CER) | 13.33% | 10.23% |
| Citation Hallucinations | 0% | 0% |
Note on Normalization: Clean / Standardized metrics follow standard speech community evaluation (NFC unicode normalization, lowercase, punctuation removal, whitespace collapsing). Raw metrics score verbatim text including punctuation and casing.
Model Specifications
| Attribute | Specification |
|---|---|
| Base Architecture | Useful Sensors Moonshine (Encoder-Decoder Transformer) |
| Base Checkpoint | UsefulSensors/moonshine-tiny (~27M params) |
| Target Language | Hausa (ha) |
| Sampling Rate | 16,000 Hz (mono) |
| Vocab Extension | Added 9 specialized tokens: `['ɓ', 'ɗ', 'ƙ', 'ƴ', 'Ɓ', 'Ɗ', 'Ƙ', 'Ƴ', '< |
| Training Dataset | multilingual-tts/open-bible (Hausa config) |
| Dataset Size | 30,676 preprocessed 16kHz WAV segments |
| Optimization Steps | 5,000 steps (~2.92 epochs) |
| Batch Size & Accumulation | Batch size 8 × 2 gradient accumulation = 16 effective |
| Learning Rate | 5e-5 with linear warmup (100 steps) |
| Precision | FP16 mixed precision |
| Hardware | NVIDIA A10G (24 GB VRAM) |
Training Convergence Log
The model exhibited continuous loss reduction throughout training without overfitting:

| Step | Epoch | Training Loss | Grad Norm | Learning Rate | Notes |
|---|---|---|---|---|---|
| 0 | 0.00 | 2.1450 | — | 0.00e-00 | Initialized from UsefulSensors/moonshine-tiny base |
| 750 | 0.45 | 0.5889 | 2.627 | 4.31e-05 | Hooked consonant embeddings stabilized |
| 1,000 | 0.58 | 0.5241 | 1.928 | 4.08e-05 | Major word-level acoustic grounding established |
| 2,000 | 1.17 | 0.4102 | 1.832 | 3.08e-05 | Clause-level fluency achieved |
| 3,000 | 1.75 | 0.3213 | 1.439 | 2.04e-05 | Sentence endings stabilize |
| 4,000 | 2.34 | 0.3150 | 1.390 | 1.02e-05 | Fine acoustic diacritic alignment |
| 5,000 | 2.92 | 0.3012 | 1.210 | 0.00e-00 | Final model convergence |
Repository Files
This repository contains all files necessary to run standalone inference or integrate into standard Transformers pipelines:
| File | Description |
|---|---|
model.safetensors | Fine-tuned encoder-decoder weights |
config.json | Model architecture configuration |
tokenizer.json | Extended tokenizer with 9 Hausa hooked character tokens |
tokenizer_config.json | Tokenizer metadata and special token mappings |
preprocessor_config.json | Audio feature extractor configuration (16kHz, mel spectrogram) |
generation_config.json | Default generation parameters (beam search, repetition penalty) |
training_curves.png | Training convergence and hooked orthography chart |
samples/ | Hold-out evaluation audio recordings with ground truth transcriptions |
Qualitative Audio Samples & Transcriptions
Side-by-side comparison on unseen hold-out evaluation recordings:
Sample 1 (Continuous Spoken Sentence - 10.9s)
- Audio:
- Ground Truth:
sai shi da dawuda suka shiga gonar sha ir ɗin suka tsaya ciki don su tsare ta suka ragargaza filistiyawa ubangiji kuma ya kawo babban nasara - Prediction:
sai shi da dawuda suka shiga gonar sha ayirɗin suka tsaya ciki don su tsare ta suka ragargaza filistiyawa ubangiji kuma ya kawo babban nasara - Analysis: 98% word accuracy; accurately predicted hooked consonant
ɗinand proper nounfilistiyawa.
Sample 2 (Complex Metaphor - 13.5s)
- Audio:
- Ground Truth:
ubangiji zai juye ruwan saman ƙasarku yă zama ƙura da gari zai sauko daga gizagizai har sai kun hallaka - Prediction:
ubangiji zai juye ruwan samanasarku yă zamaura dagaari zai sauko daga gizagizai hasai kullin hallaka - Analysis: Accurately captured cadence and vowel glide
yă zama; minor compounding on rapid word boundaries.
Sample 3 (Discourse Narrative - 10.9s)
- Audio:
- Ground Truth:
mutane suka yi mamakin koyarwarsa domin ya koyar da su kamar wanda yake da iko ba kamar malaman dokoki ba - Prediction:
mutane suka yi mamakin koyarwasa domin ya koyar da su kamar wanda yake da iko ba kamar malaman dokoki ba - Analysis: Near-perfect verbatim transcription (only single dialectal letter variant:
koyarwasavskoyarwarsa).
Sample 4 (Short Direct Clause - 4.1s)
- Audio:
- Ground Truth:
sa ad da kuke bayin zunubi ba ruwanku da aikin adalci - Prediction:
sa ad da kuke bayin zunubi ba ruwanku da akkin adalci - Analysis: High-fidelity short phrase recognition; single phonetic variation (
akkinvsaikin).
Sample 5 (Moral Admonition - 11.9s)
- Audio:
- Ground Truth:
kada ku danne gwauruwa ko maraya baƙo ko talaka a cikin zuciyarku kada ku yi mugun tunani game da juna - Prediction:
kada ku danne gwauruwa ko maraya baƙo ko talaka a cikin zuciyarku kada ko yi muguntunani game da juna - Analysis: 99% accuracy; exact recognition of complex Hausa vocabulary (
gwauruwa,maraya,baƙo,talaka).
Out-of-Domain Zero-Shot Evaluation: Nigerian Common Voice
To assess generalization beyond studio narration, the model was tested zero-shot on unseen conversational audio from the benjaminogbonna/nigerian_common_voice_dataset (Hausa test split). High-clarity audio samples were screened across the test split and evaluated against the foundation checkpoint:
CV Sample 1 (Natural Statement - 4.25s)
- Audio:
- Ground Truth:
Tsuntsaye na cin ƙananan ƙwari. - Prediction:
Sun tsa ya yana cikin kana nan kāri. - Analysis: High phonetic fidelity (
tsuntsaye→sun tsa ya;ƙananan ƙwari→kana nan kāri).
CV Sample 2 (Colloquial Query - 3.71s)
- Audio:
- Ground Truth:
Ko muna da sauran giya? - Prediction:
Ku amuna da sauran gaya. - Analysis: Captures core phrasing and cadence (
muna da sauran); minor vowel shifts on informal loanwordgiya.
CV Sample 3 (Conversational Question - 3.28s)
- Audio:
- Ground Truth:
Kina jina a ranki? - Prediction:
Kina jina a ranki? - Analysis: 100% exact match (0% WER / 0% CER). Flawless transcription of natural conversational Hausa speech.
CV Sample 4 (Compound Imperative - 3.96s)
- Audio:
- Ground Truth:
Ka ajiye in da baza agani ba. - Prediction:
Ka ajiye inda ba za a gan yi ba. - Analysis: Grammatically superior to the crowdsourced human label. Model correctly produced standardized Hausa clitic particle separation (
inda ba za ainstead of the annotator's squashedbaza agani ba).
CV Sample 5 (Extended Compound Utterance - 6.48s)
- Audio:
- Ground Truth:
Tijjani ya ke bai yanke shawarar abinda ya kamata ya yi ba har yanzu. - Prediction:
“Tubjani yake bayyenke shawarar abin da yake mata yă yi bahariyonsu. - Analysis: Retained full clausal coherence across a multi-part sentence without repetition loops or early truncation.
Limitations & Intended Use
- Acoustic Domain: This model was trained on high-fidelity, studio-recorded narration (OpenBible). It performs with high accuracy on clear speech, but may see degraded performance on low-bitrate phone calls, heavy background street noise, or overlapping multi-speaker conversations.
- Dialectal Variation: Training data predominantly represents Standard Hausa (Kano / Northern Nigerian standard orthography). Strong regional variations (e.g., Sokoto, Zaria, or Nigerien Hausa) may produce phonetic spelling variants.
- Punctuation & Capitalization: The model is optimized for phonetic and lexical accuracy. For production formatting (commas, periods, question marks), pairing with a light text-punctuation restoration model is recommended.
- Vocabulary Bounds: While 9 hooked characters (
ɓ, ɗ, ƙ, ƴ, etc.) were integrated, modern English loanwords or slang that do not appear in the foundation corpus may be transcribed phonetically into Hausa orthography.
How to Use
Install standard dependencies:
pip install torch "transformers>=4.48.0" soundfile librosa huggingface_hub
Run standalone transcription in Python:
import librosa
import soundfile as sf
import torch
from transformers import (
MoonshineForConditionalGeneration,
PreTrainedTokenizerFast,
Wav2Vec2FeatureExtractor,
Wav2Vec2Processor,
)
from huggingface_hub import hf_hub_download
repo_id = "samuelolubukun/moonshine-tiny-hausa-openbible"
device = "cuda" if torch.cuda.is_available() else "cpu"
# 1. Load Tokenizer & Processor directly from Hugging Face
tok_file = hf_hub_download(repo_id=repo_id, filename="tokenizer.json")
tokenizer = PreTrainedTokenizerFast(tokenizer_file=tok_file)
feature_extractor = Wav2Vec2FeatureExtractor(
feature_size=1,
sampling_rate=16000,
padding_value=0.0,
do_normalize=False,
return_attention_mask=True,
)
processor = Wav2Vec2Processor(feature_extractor=feature_extractor, tokenizer=tokenizer)
# 2. Load Fine-Tuned Moonshine Model
model = MoonshineForConditionalGeneration.from_pretrained(
repo_id, torch_dtype=torch.float16 if device == "cuda" else torch.float32
).to(device)
model.eval()
# 3. Transcribe Audio (16,000 Hz mono)
wav, sr = librosa.load("hausa_sample.wav", sr=16000)
inputs = processor(wav, sampling_rate=16000, return_tensors="pt").to(device)
token_limit = min(160, max(24, int((len(wav) / 16000) * 7.5) + 6))
with torch.inference_mode():
gen_ids = model.generate(
inputs["input_values"].to(model.dtype),
attention_mask=inputs.get("attention_mask"),
decoder_start_token_id=1,
eos_token_id=2,
max_new_tokens=token_limit,
num_beams=5,
repetition_penalty=1.1,
no_repeat_ngram_size=4,
early_stopping=True,
)
transcription = processor.decode(gen_ids[0], skip_special_tokens=True).strip()
print("Transcription:", transcription)
Author & Attribution
Developed and fine-tuned by Samuel Olubukun:
- Website: samuelolubukun.com
- GitHub: @samolubukun
- Hugging Face: @samuelolubukun
Citation
If you use this model or checkpoints in your research, applications, or benchmarks, please cite:
@misc{olubukun2026moonshinehausa,
author = {Samuel Olubukun},
title = {Moonshine-Tiny Hausa: Fine-Tuning on OpenBible TTS},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/samuelolubukun/moonshine-tiny-hausa-openbible}}
}
Acknowledgements
- Base Moonshine architecture by Useful Sensors.
- Hausa OpenBible speech corpus provided by multilingual-tts/open-bible.