Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: [fa]
|
| 3 |
+
license: cc-by-nc-4.0
|
| 4 |
+
library_name: onnx
|
| 5 |
+
pipeline_tag: automatic-speech-recognition
|
| 6 |
+
tags: [automatic-speech-recognition, speech, persian, farsi, fastconformer, ctc, streaming, cache-aware-streaming, on-device, tract, rust, shenava, shenava-1, visualears, edge]
|
| 7 |
+
base_model: [Reza2kn/Shenava-Rizeh-v1.0]
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Shenava — Rizeh v1.0 (32M) · cache-aware streaming · **native-Rust (tract)**
|
| 11 |
+
|
| 12 |
+
Cache-aware **streaming** CTC export of [`Shenava-Rizeh-v1.0`](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.0)
|
| 13 |
+
that runs in the **pure-Rust [tract](https://github.com/sonos/tract) engine** — no C++, no ONNX Runtime.
|
| 14 |
+
Part of [VisualEars / Shenava](https://shenava.app): offline, on-device, streaming Persian ASR for the Deaf/Hard-of-Hearing.
|
| 15 |
+
|
| 16 |
+
Quality: **near-exact** (12.11% golden-6669 WER). **RTF ≈ 0.027** (30.0 ms/chunk on x86 CPU; chunk = 1.12 s audio).
|
| 17 |
+
|
| 18 |
+
## ⚠️ Requires patched tract (until upstreamed)
|
| 19 |
+
Stock tract rejects NeMo cache-aware streaming graphs in two inference-layer spots. Fix = a **23-line, 2-file patch**
|
| 20 |
+
(`shenava_tract_streaming.patch`, included) — PR open at **[sonos/tract#2441](https://github.com/sonos/tract/pull/2441)**.
|
| 21 |
+
Build tract with the patch, then load `model.onnx` normally. The graph itself is valid (identical decode to ONNX Runtime).
|
| 22 |
+
|
| 23 |
+
## Streaming contract
|
| 24 |
+
Per-step inputs / outputs (fixed shapes, greedy CTC):
|
| 25 |
+
- `audio_signal` `[1,80,121]` — un-normalized log-mel chunk (NeMo featurizer, `normalize=NA`)
|
| 26 |
+
- `length` `[1]` i64 — true valid frames in the chunk
|
| 27 |
+
- `cache_last_channel` `[1,16,70,256]`, `cache_last_time` `[1,16,256,8]`, `cache_last_channel_len` `[1]` i64 — start zeros / 0
|
| 28 |
+
- → `logprobs` `[1,T',1025]` + next caches
|
| 29 |
+
|
| 30 |
+
**Chunking:** feed 121-mel-frame chunks, shift 112 (9-frame pre-encode overlap). First chunk is 105 → pad to 121; pad the tail too; pass the true `length`. Thread the `*_next` caches back each step (cast `cache_last_channel_len_next` to i64). **Greedy CTC: carry the previous token across chunk boundaries** when collapsing repeats; blank id = 1024; map via `tokens.txt`; `▁`→space.
|
| 31 |
+
|
| 32 |
+
## Numbers are spoken-form → ITN
|
| 33 |
+
The model spells numbers (هشت not ۸). Apply `persian_itn.py` at display for spoken→Persian-digit (cardinals + هزار/میلیون/میلیارد + «و» + compounds).
|
| 34 |
+
|
| 35 |
+
## Shenava-1 family (all native-Rust streaming)
|
| 36 |
+
- [Koochik 114M](https://huggingface.co/Reza2kn/Shenava-Koochik-v1.0-tract-streaming) — flagship
|
| 37 |
+
- [Rizeh 32M](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.0-tract-streaming) — mid
|
| 38 |
+
- [Rizeh-Pizeh 6.9M](https://huggingface.co/Reza2kn/Shenava-Rizeh-Pizeh-v1.0-tract-streaming) — tiniest
|