Shenava Rizeh v1.6: sherpa-onnx
Shenava Rizeh v1.6 is a 60M Zipformer2 RNN-T for Persian (plus English). This repo exports it for sherpa-onnx as an offline transducer, plus a streaming encoder in streaming/. It runs on Android, iOS, macOS, Windows, Linux and WebAssembly. The Persian language vector is built into the encoder.
| File | Size |
|---|---|
encoder.onnx, decoder.onnx, joiner.onnx |
fp32 (235 MB / 5 MB / 4 MB) |
encoder.int8.onnx, decoder.int8.onnx, joiner.int8.onnx |
int8 (68 MB / 1 MB / 1 MB) |
encoder.int4.onnx |
int4 MatMulNBits, block 32 (46 MB). Use it with the fp32 or int8 decoder/joiner. |
streaming/encoder.onnx, .int8.onnx, .int4.onnx |
cache-aware streaming encoder: 320 ms chunks, 2.56 s left context |
tokens.txt |
2,080 tokens |
import sherpa_onnx, soundfile as sf
rec = sherpa_onnx.OfflineRecognizer.from_transducer(
encoder="encoder.int8.onnx", decoder="decoder.int8.onnx", joiner="joiner.int8.onnx",
tokens="tokens.txt", num_threads=2, decoding_method="modified_beam_search", max_active_paths=4)
x, sr = sf.read("audio.wav", dtype="float32") # 16 kHz mono
s = rec.create_stream(); s.accept_waveform(sr, x); rec.decode_stream(s)
print(s.result.text)
Streaming: sherpa_onnx.OnlineRecognizer.from_transducer(encoder="streaming/encoder.int8.onnx", decoder="decoder.int8.onnx", joiner="joiner.int8.onnx", tokens="tokens.txt", ...).
Accuracy
Scored on the held-out half of the Triple Threat benchmark (EVEN, 2,758 clips), official TT, no LM, beam 4. Lower is better.
| v1.5 | v1.6 | |
|---|---|---|
| Offline fp32 / int8 / int4 | 4.35 / 4.37 / 4.24 | 4.20 / 4.20 / 4.26 |
| Streaming fp32 / int8 / int4 | 5.31 / 5.32 / 5.22 | 5.24 / 5.25 / 5.34 |
For the best accuracy, use the tinyasr build with the in-beam LM from the main repo: 3.74 official TT on the full benchmark.
Speaker diarization: Shenava-Rizeh-v1.6-Diarization has encoder_spk.onnx. It's this same encoder with an extra speaker-feature output, and it's a drop-in replacement for encoder.onnx.
All formats
- Shenava-Rizeh-v1.6: int4
.tzffor the tinyasr engine (CPU/WASM), KenLM, engine patch, training code - Shenava-Rizeh-v1.6-sherpa-onnx: offline + streaming, fp32 / int8 / int4
- Shenava-Rizeh-v1.6-ONNX-fp16
- Shenava-Rizeh-v1.6-tract-streaming: pure Rust
- Shenava-Rizeh-v1.6-CoreML-fp16 and Shenava-Rizeh-v1.6-CoreML-iOS15-fp16 (streaming)
- Shenava-Rizeh-v1.6-Diarization: who spoke when, 3.5M parameters on top of this encoder
GPL-3.0-or-later, like the tinyasr engine and models it derives from. Base model and engine: dkaraush/tinyasr. The original models were trained primarily on YODAS v3 (CC BY 3.0). Architecture: Zipformer2 from k2-fsa/icefall (Apache-2.0). Poetry audio: Ganjoor recitations.
Model tree for Reza2kn/Shenava-Rizeh-v1.6-sherpa-onnx
Base model
Reza2kn/Shenava-Rizeh-v1.6