File size: 3,186 Bytes
3cb81ea | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | ---
language:
- fa
- en
license: gpl-3.0
library_name: coreml
pipeline_tag: automatic-speech-recognition
tags: [persian, farsi, asr, zipformer, transducer, shenava, coreml, ios, streaming]
base_model: Reza2kn/Shenava-Rizeh-v1.6
---
# 🎙️ Shenava-Rizeh-v1.6-CoreML-iOS15-fp16 (streaming)
A cache-aware **streaming** Core ML export of [Shenava Rizeh v1.6](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6), for live captions on iOS 15+ / macOS 12+.
- Format: NeuralNetwork with fp16 weights.
- Each encoder call takes **320 ms** of audio and returns 8 frames.
- Attention looks back 2.56 s, and every cache is an explicit input and output.
It has the same interface as the v1.5 streaming repo; only the file names change from v1_5 to v1_6.
| Encoder step | Target | Size | Checked on an M2 |
|---|---|---|---|
| `shenava_rizeh_v1_6_encoder_streaming_c16_l128_ios15_fp16.mlmodel` | iOS 15+ | 114 MB | ✅ tokens identical to onnxruntime |
| `shenava_rizeh_v1_6_encoder_streaming_c16_l128_ios15_int8.mlmodel` | iOS 15+, int8 weights | 58 MB | ✅ tokens identical |
| `ios18/shenava_rizeh_v1_6_encoder_streaming_c16_l128_ios18_int4.mlpackage` | iOS 18+, int4 (blocks of 32) | 35 MB | ✅ tokens identical |
The decoder and joiner (`*_ios15_fp16.mlmodel`) are shared by all three encoders.
**Accuracy:** the identical ONNX streaming graph scores TT 5.24 (fp32), 5.25 (int8) and 5.34 (int4) on the held-out half, no LM. v1.5 scored 5.31 / 5.32 / 5.22.
**Speed:** v1.5 measured about 16 ms per step on the M2 (fp16), and the graph is the same.
## Streaming loop
1. Compute 80-dim kaldi fbank (same settings as the [fp16 repo](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-CoreML-fp16)).
2. Each step, feed **45 frames** and advance **32**.
3. Feed every `new_<cache>` back in. The caches start at zero, and `processed_lens` is int32 (`..._manifest.json` lists the shapes).
4. Run greedy RNN-T per output frame:
- Blank is 0 and the context is the last 2 tokens, starting at [0, 0].
- **Mask ids 32–1055.**
5. Append about 0.8 s of silence at the end of speech.
`run_coreml_stream.py [encoder]` and `reference/` are the Mac check. The export scripts (`export_coreml_stream.py`, `dj_ios15.py`, `cmq2.py`) rebuild every file.
## All formats
- [Shenava-Rizeh-v1.6](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6): int4 `.tzf` for the tinyasr engine (CPU/WASM), KenLM, engine patch, training code
- [Shenava-Rizeh-v1.6-sherpa-onnx](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-sherpa-onnx): offline + streaming, fp32 / int8 / int4
- [Shenava-Rizeh-v1.6-ONNX-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-ONNX-fp16)
- [Shenava-Rizeh-v1.6-tract-streaming](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-tract-streaming): pure Rust
- [Shenava-Rizeh-v1.6-CoreML-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-CoreML-fp16) and [Shenava-Rizeh-v1.6-CoreML-iOS15-fp16](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-CoreML-iOS15-fp16) (streaming)
- [Shenava-Rizeh-v1.6-Diarization](https://huggingface.co/Reza2kn/Shenava-Rizeh-v1.6-Diarization): who spoke when, 3.5M parameters on top of this encoder
## License
GPL-3.0, inherited from tinyasr.
|