Reza2kn's picture
Shenava Rizeh v1.6
71f4dea verified
|
Raw History Blame Contribute Delete
2.98 kB
metadata
language:
  - fa
  - en
license: gpl-3.0
library_name: tract
pipeline_tag: automatic-speech-recognition
tags:
  - persian
  - farsi
  - asr
  - zipformer
  - transducer
  - shenava
  - tract
  - rust
  - streaming
base_model: Reza2kn/Shenava-Rizeh-v1.6

Shenava Rizeh v1.6: tract streaming

A cache-aware streaming export of Shenava Rizeh v1.6 for the pure-Rust tract engine. Each step consumes 320 ms of audio with 2.56 s of left context. harness/main.rs is a complete working example.

File Size Streaming TT (held-out half, no LM, onnxruntime) tract tokens = onnxruntime (4 clips)
encoder.onnx (fp32) 228 MB 5.24 ✅ identical
encoder.int4.onnx (MatMulNBits, block 32) 69 MB 5.34 ✅ identical
encoder.int8.onnx (MatMulInteger) 60 MB 5.25 ✅ identical (slow in tract: dynamic activation quant)

The decoder and joiner are fp32 and shared by every encoder.

Speed: the graph is identical to v1.5's. v1.5 measured about 24 ms (fp32) / 43 ms (int4) / 190 ms (int8) per 320 ms chunk, single thread, on a desktop x86. Use fp32 or int4.

Streaming contract

  • Features: 80-dim kaldi fbank (fbank_torch.py): samples in [-1, 1], povey window, snip_edges=false, 20–7600 Hz.
  • Steps: feed x (1, 45, 80) each step and advance 32 frames. Append about 0.8 s of silence at the end of speech.
  • Encoder state: x plus 92 caches (reference/ref0.shapes lists order, dtype and shape). Start every cache at zero, feed each new_* back, and cast new_processed_lens to i64.
  • RNN-T:
    • decoder takes y i64 (1, 2), starting at [0, 0].
    • joiner(encoder_out[t], decoder_out) returns 2,080 logits.
    • Blank is 0. Mask ids 32–1055 (the English block).
cargo run --release -- . reference/ref0 encoder.onnx   # harness/main.rs as src/main.rs; tract @ Reza2kn/tract 4259abe
python stream_ref.py . some.wav out/prefix            # onnxruntime reference for any wav

All formats

License

GPL-3.0, inherited from tinyasr.