GilgameshWind/x-asr-streaming-demo
0
X-ASR Streaming Demo
This Space provides a real-time streaming ASR demo for X-ASR-zh-en, deployed with sherpa-onnx.
Features
- Real-time microphone streaming recognition.
- Streaming chunk-size selection:
160 ms,480 ms,960 ms, and1920 ms. - Gradio live input is configured with a 160 ms stream interval and a 10-minute per-event time limit.
- Independent stream state for each browser session.
- Globally cached recognizers to avoid reloading ONNX models for every user.
- Automatic cleanup for idle sessions.
Model
The demo downloads ONNX model files from:
- Model repo: GilgameshWind/icefall_X_ASR_streaming
Each model variant uses a matched tokens.txt, encoder, decoder, and joiner from the corresponding deployment folder.
Concurrency Notes
The Space creates an independent sherpa-onnx stream for each browser session, so recognition states are not shared across users.
The recognizer object is cached per chunk-size model and guarded by a short lock during decode calls. This avoids state contamination while keeping model loading efficient. Actual throughput depends on the Space hardware. For heavy public traffic, upgrade the Space hardware or run multiple replicas.
