Downloads · 30 days
11
8% of all-time downloads
samwell/dondo-nano-twi-ewe
dondo-nano-twi-ewe is a automatic speech recognition model from samwell. Use it when you need speech turned into text. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
Compressed, on-device-friendly versions of Khaya AI's DONDO speech model for Twi and Ewe. The default model in this repo is Nano-L12 (315.6M params). Smaller variants and an int8 ONNX build are in subfolders.
Downloads · 30 days
11
8% of all-time downloads
All-time downloads
138
Public
Parameters
316M
3.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.3 GB · 60%
From the Hugging Face model README
Compressed, on-device-friendly versions of Khaya AI's DONDO speech model for Twi and Ewe. The default model in this repo is Nano-L12 (315.6M params). Smaller variants and an int8 ONNX build are in subfolders.
The recipe is depth reduction with a warm start: a shallower Wav2Vec2-BERT student is initialized from evenly-spaced layers of the 24-layer parent (plus its feature projection, adapter, and CTC head), then fine-tuned on WAXAL Twi and Ewe. Knowledge distillation from the parent was tested and dropped, because the parent is out-of-domain on WAXAL and its soft targets made the student worse.
Blended error = 0.5·WER + 0.5·CER on WAXAL validation (Twi/Ewe mean), greedy CTC decode, normalized text. All rows below are trained on the same WAXAL data (CTC, no distillation).
| Model | Layers | Params | Disk (fp32) | CPU RTF | Blended |
|---|---|---|---|---|---|
| Fine-tuned parent | 24 | 605.8M | 2423 MB | 0.252 | 0.216 |
| Nano-L12 (default) | 12 | 315.6M | 1262 MB | 0.132 | 0.261 |
Nano-L6 (nano-l6/) | 6 | 170.5M | 682 MB | 0.069 | 0.387 |
Nano-L3 (nano-l3/) | 3 | 98.0M | 392 MB | 0.036 | ~0.57 |
Halving the model (606M to 316M) costs 0.045 blended error. Nano-L12 also beats a zero-shot Meta MMS-1b (~965M, ~0.37 on these clips), though that comparison favors the nano, which saw in-domain data.
int8 (onnx/): ONNX Runtime dynamic int8 shrinks Nano-L12 from 1262 MB to 319 MB (~4x) for
almost no accuracy change (0.266 to 0.269 in the same runtime). It does not speed up inference on
CPU, since the model is already faster than real time; the win is size.
from transformers import AutoProcessor, AutoModelForCTC
import torch, librosa
proc = AutoProcessor.from_pretrained("samwell/dondo-nano-twi-ewe") # Nano-L12
model = AutoModelForCTC.from_pretrained("samwell/dondo-nano-twi-ewe").eval()
# smaller variants: subfolder="nano-l6" or "nano-l3"
y, _ = librosa.load("clip.wav", sr=16000)
feats = proc(y, sampling_rate=16000, return_tensors="pt").input_features
with torch.no_grad():
ids = model(feats).logits.argmax(-1)
print(proc.batch_decode(ids)[0])
Released under CC-BY-SA-4.0 to respect the share-alike terms of the WAXAL training data.