CoolFace
Apppublic

munzurul/Speaklar_Bangla_ASR

sourceHugging Faceapache-2.0updated 16d agoView on Hugging Face
0likes
App README

Speaklar Bangla ASR

Record Bengali speech with a microphone or upload an audio clip and receive a transcript. The application uses `munzurul/speaklar_bangla_asr/speaklar_bangla_asr.nemo`, the epoch 2 fine-tuned NeMo CTC model, pinned to model commit 1d6925c49d7ef6ee6a7937dc5c24c796bbd373b4.

Private-model access

In Space Settings → Variables and secrets, set the `HF_TOKEN` secret to a Hugging Face token with read access to the private model repository. Never put the token in source code. Visitors do not provide model credentials; the server downloads and runs the model. Model cache files are blocked from Gradio file serving. Keep the Space private to restrict who can use it.

Optional environment variables: MODEL_REPO_ID, MODEL_FILENAME, and MODEL_REVISION. Use a matching revision if changing the repository or file. For local testing, LOCAL_MODEL_PATH can point to an existing .nemo export.

Runtime

Supports the existing CPU hardware and uses CUDA when available. Speaklar and Titu load lazily and reuse their models. IndicConformer runs in a separate process using the pinned AI4Bharat NeMo fork; it loads for each request and releases its memory when finished. Requests run one at a time. Audio is converted to mono 16 kHz, limited to two minutes and 25 MB, and longer clips are split near low-energy boundaries. Words around chunk boundaries may be less accurate. Converted files are removed after each request; Gradio's input cache is cleaned hourly for files older than one hour.

Run locally

The Docker image provides both NeMo runtimes. Build and run it with:

bash
docker build -t speaklar-asr .
docker run --rm -p 7860:7860 -e HF_TOKEN speaklar-asr

The license metadata applies to this demo's code, not a new license grant for the model or its training data.

IndicConformer runtime

The Bengali IndicConformer model requires AI4Bharat's NeMo fork for its multilingual tokenizer and decoder. The Docker build installs commit 8dce88cf8e94963e2033c3137f7b9993b51db88a under /opt/indic-runtime, together with compatible legacy dependencies. Only the IndicConformer subprocess uses that directory, selecting CTC decoding with language_id="bn". All three buttons share one inference queue. Failures appear as errors instead of transcript text.

For local worker testing, set INDIC_RUNTIME_PATH to the fork and dependency directories (separated by :), and optionally set LOCAL_INDIC_MODEL_PATH to the downloaded Bengali .nemo file. The worker has a ten-minute timeout.