Instructions to use LocalDoc/speakwrite-azerbaijani with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use LocalDoc/speakwrite-azerbaijani with NeMo:
import nemo.collections.asr as nemo_asr asr_model = nemo_asr.models.ASRModel.from_pretrained("LocalDoc/speakwrite-azerbaijani") transcriptions = asr_model.transcribe(["file.wav"]) - Notebooks
- Google Colab
- Kaggle
Run with pip install balbal: ONNX graphs + "languages": ["az"]
Salam! Mən Eray, balbal-ın müəllifiyəm. balbal-v2-manas resepti əsasında öyrədilmiş Azərbaycan dili modelini görmək çox xoşdur 🙌
This PR makes the model run with pip install balbal. Version 0.3.0 (released today) loads models trained on the balbal architectures straight from a Hugging Face repo:
import balbal
model = balbal.load("LocalDoc/speakwrite-azerbaijani")
print(model.transcribe("speech.wav")["text"])
or balbal run --model LocalDoc/speakwrite-azerbaijani speech.wav. It runs on CPU with your KenLM and uses your decoder.json (alpha 1.0, beta 2.0).
Changes
model.json: adds"name"and"languages": ["az"]. The language turns off balbal's Turkish number writing (ITN), so numbers stay as words, and keeps Turkic i/İ casing for hotwords. balbal at commit1be9f88(your Use section) reads only"model", so nothing changes there.onnx/: the fast graph (model.onnx, its custom kernels ship in the pip wheel) and the standard-operator graph (model-plain.onnx), exported from this repo'smodel.ptwith balbal'sinference/export_onnx.py(int8 MatMul weights and memory table, as in balbal-v2-manas).export.jsonholds the parity check against PyTorch: frame argmax agreement 0.9938 (fast) / 0.9933 (plain).
Check: FLEURS az test, 914 clips, your text_norm references, case and punctuation ignored, pip 0.3.0 on CPU with 8 threads:
| graph | WER | CER |
|---|---|---|
| fast | 11.08 | 3.62 |
| plain | 11.09 | 3.61 |
Your card has 10.98 / 3.57 with PyTorch. The 3.2 h took 133 s with the fast graph.
If you would rather export the graphs yourselves: from https://github.com/erayyap/balbal run inference/kernels/build.sh, then python inference/export_onnx.py --model-dir MODEL_DIR clip1.wav clip2.wav clip3.wav (a few seconds of speech each, for the parity check). The current balbal code also reads refiner.json and decoder.json from the model folder, so the copy step in your Use section is no longer needed; it could become pip install balbal plus the snippet above.
@erayyapagci aleykum salam
Thanks you
Checked locally with balbal 0.3.0: FLEURS test 11.03 / 3.61 (fast and plain), about 84x on 8 threads, and overlap windows improved results on long audio. Merging.