| # bengali-asr — 1:1 Verbatim ONNX (rebranded folder, ai4bharat weights verbatim) |
|
|
| **Folder `bengali-asr/` is separate from `neo/` (BanglaNeo bn-only) and `models/` original `.nemo`. Display name `bengali-asr` but ONNX metadata keeps `original_source: ai4bharat/indicconformer_stt_bn_hybrid_ctc_rnnt_large` for audit.** |
| |
| * **Verbatim:** `Conformer-L 120M 17×512` encoder + `preprocessor` `AudioToMel 80` **inside** ONNX, `Conv1d 512→5633` (22*256+blank 5632) kept, 22 tokenizer triples verbatim (`tokenizer/` 66 files). No slicing like `neo` `257`. Input `wav [1,T] 16k mono float32` + `wav_len [1]` → `logits [1,T/4,5633]` → slice `bn [256:512]+blank 5632` → 257. |
| * **Files:** |
| * `models/bengali-asr-wav-ctc-5633.onnx` (+`.data` 469 MB) — fused `wav→5633`, 472 MB, **primary 1:1** |
| * `models/bengali-asr-encoder-wav.onnx` (+`.data` 458 MB) — `wav→enc 512` |
| * `models/bengali-asr-decoder-ctc-5633.onnx` (+`.data` 11 MB) — `enc→5633` |
| * `models/tokenizer/` 22 langs hash names verbatim |
| * `models/config.json` (`display_name: bengali-asr`, `original_source: ai4bharat/...`, `vocab 5632/5633`, `langs 22`) |
| * `models/tokenizer_map.json` 22 entries |
|
|
| **Why not BanglaNeo:** BanglaNeo `neo/models/bangla-neo-conformer-bn-ctc.onnx` 462 MB is `bn`-only 257, `mel` outside, rebranded metadata (no ai4bharat). `bengali-asr` is `~5-10%` slower (5633 argmax) but keeps 22 langs + `wav` in + audit provenance. Use BanglaNeo for small/fast `bn` only, `bengali-asr` for verbatim audit. |
|
|
| **Quick start (new identity, separate folder, port 8002):** |
| ```powershell |
| # Reuse .venv311 (Python 3.11, onnxruntime CPU, no nemo at inference) |
| C:\Users\Riasat\BengaliSTT\.venv311\Scripts\python.exe bengali-asr/src/transcribe_bengali_asr.py --audio neo/test_bn.mp3 --lang bn |
| # -> bengali-asr (bn): আমি বাংলায় কথা বলছি logits(1,62,5633) sliced [256:512]+5632 |
| |
| # Web 1:1 verbatim |
| C:\Users\Riasat\BengaliSTT\.venv311\Scripts\python.exe bengali-asr/src/app_bengali_asr.py |
| # http://localhost:8002 (vs neo 8001, old app 8000) |
| # curl -F audio=@sample.wav -F lang=bn http://localhost:8002/transcribe |
| ``` |
|
|
| **Compare:** |
| * `BanglaNeo 8001`: `bn` 257, `mel` in, 462 MB, `http://localhost:8001` — small/fast |
| * `bengali-asr 8002`: `22` 5633, `wav` in, 472 MB, verbatim — audit |
|
|
| **Providers:** `CUDA→CPU` auto `pick_providers()` `onnxruntime` `CPUExecutionProvider` default, `onnxruntime-gpu` for CUDA. |
|
|
| **Note:** Folder `bengali-asr/` is separate, does not overwrite `neo/` or `models/`. Both can run together (8001 + 8002). |
|
|