This repository contains the NPU-adapted inference scripts for the Dolphin-small multilingual ASR model on Huawei Ascend NPU.
| Item | Value |
|---|---|
| Model Name | DataoceanAI/dolphin-small |
| Parameters | 372 M |
| Architecture | CTC-Attention (E-Branchformer + Transformer) |
| Languages | 40 Eastern languages + 22 Chinese dialects |
| Original Repo | ModelScope |
| Item | Version / Model |
|---|---|
| NPU | Ascend 910 |
| CANN | 8.5.1 |
| PyTorch | 2.9.0+cpu |
| torch_npu | 2.9.0.post1 |
# Install core dependencies
pip install torch==2.9.0 torch-npu==2.9.0.post1
pip install dataoceanai-dolphin soundfile
# Download model weights
modelscope download --model DataoceanAI/dolphin-small --local_dir /path/to/modeldolphin-small/
├── inference.py # NPU inference script
├── benchmark.py # Performance benchmark
├── accuracy.py # Accuracy validation (CPU vs NPU)
├── assets/ # Test audio samples
└── output/ # Output logspython inference.py \
--audio assets/test_audio.wav \
--model_dir /path/to/model \
--device npu \
--lang_sym zh \
--region_sym CNExample output:
{
'text': '<zh><CN>欢迎大家来体验达摩院推出的语音识别模型',
'text_nospecial': '欢迎大家来体验达摩院推出的语音识别模型',
'language': 'zh',
'region': 'CN',
'inference_time_sec': 0.235
}python benchmark.py \
--audio assets/test_audio.wav \
--device npu \
--iterations 10Benchmark result (Ascend 910, attention_rescoring, beam_size=10):
| Metric | Value |
|---|---|
| Avg latency | 0.23s |
| P50 latency | 0.23s |
| P90 latency | 0.23s |
| Throughput | 4.36 samples/sec |
python accuracy.py \
--audio assets/test_audio.wav \
--lang_sym zh \
--region_sym CNValidation result:
| Metric | CPU Baseline | NPU Output | Match |
|---|---|---|---|
| Transcript | 欢迎大家来体验达摩院推出的语音识别模型 | 欢迎大家来体验达摩院推出的语音识别模型 | Yes |
| Language | zh | zh | Yes |
| Region | CN | CN | Yes |
| Accuracy | 100% | PASS |
device="npu" to load_model().dolphin package are required.soundfile instead of ffmpeg to reduce external binary dependencies.@article{dolphin2025,
title={Dolphin: A Large-Scale Multilingual Multitask ASR Model for 40 Eastern Languages},
author={Dataocean AI and Tsinghua University},
journal={arXiv preprint arXiv:2503.20212},
year={2025}
}