| Field | Value |
|---|---|
| Model | sherpa-onnx-streaming-zipformer-bilingual-zh-en-2023-02-20 |
| Task | Automatic Speech Recognition (ASR) |
| Architecture | Streaming Zipformer Transducer (Encoder + Decoder + Joiner) |
| Languages | Chinese (ZH) + English (EN) |
| Framework | ONNX Runtime + torch_npu |
| Hardware | Ascend NPU (CANN 8.5.1) |
| Precision | FP32 (ONNX models) |
| Sample Rate | 16000 Hz |
| Vocab Size | 6257 BPE tokens |
#NPU #Hardware/NPU #Ascend #CANN #ASR #Speech-Recognition #Zipformer #Streaming #Bilingual #Chinese #English #torch_npu #ONNX-Runtime
This is the Ascend NPU adaptation of the sherpa-onnx streaming Zipformer bilingual (Chinese-English) ASR model.
NPU Adaptation Strategy:
torch_npuThe streaming Zipformer transducer processes audio in 39-frame chunks with cache-based state management across 5 encoder layers.
pip install torch_npu onnxruntime soundfile numpy# NPU-accelerated feature extraction (default)
python inference.py --audio input.wav
# CPU-only mode
python inference.py --audio input.wav --cpu
# Save results as JSON
python inference.py --audio input.wav --output result.json
# Benchmark mode (feature extraction only)
python inference.pyfrom inference import SherpaASR
asr = SherpaASR(use_npu=True)
result = asr.transcribe("audio.wav")
print(result["text"])
print(f"RTF: {result['rtf']}")Run the evaluation suite:
python evaluate.pyThe evaluation generates:
eval_results/evaluation_report.md — Markdown reporteval_results/evaluation_results.json — Full results JSON| Metric | Value |
|---|---|
| Feature Extraction (NPU) | ~11ms for 3s audio |
| Feature Precision (NPU vs CPU) | < 1% relative error |
| Encoder Latency (CPU) | ~3.7s for 3s audio |
| Decoder Latency (CPU) | ~0.2s for 3s audio |
| RTF | ~1.3x realtime |
| File | Description |
|---|---|
inference.py | Main inference script with NPU acceleration |
evaluate.py | Precision and performance evaluation suite |
README.md | This document |
| Component | Version |
|---|---|
| CANN | 8.5.1 |
| NPU | Ascend 910_9362 |
| torch_npu | 2.9.0.post1 |
| torch | 2.9.0+cpu |
| onnxruntime | 1.26.0 |
| onnxruntime-cann | 1.24.4 |
| sherpa-onnx | 1.13.2 |
| Python | 3.11.14 |
| Platform | Linux aarch64 |
This adaptation follows the license of the original model. See the original HuggingFace repo for details.