g
gyccc/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online-NPU
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online 在昇腾 NPU 上的部署

模型信息

  • 模型名称:dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online
  • 任务类型:自动语音识别
  • 模型架构:Paraformer (FunASR)
  • 来源:ModelScope

验证环境

  • 硬件:昇腾 910B
  • CANN:8.5.1
  • Python:3.11
  • torch_npu:已安装
  • funasr:1.3.1

ModelScope 下载说明

pip install modelscope
python -c "from modelscope import snapshot_download; snapshot_download('dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online')"

音频预处理说明

输入音频格式:16kHz,单声道,WAV

使用 model_utils.load_wav() 加载音频,支持 torchaudio/soundfile/wave 三层 fallback。

NPU 推理命令

pip install -r requirements.txt
python inference.py

NPU 推理输出

Model: dengcunqin/speech_paraformer-large_asr_nat-zh-cantonese-en-16k-vocab8501-online
Audio: assets/test.wav
NPU transcription: 欢迎大家来体体验达摩院院输出的语语音别识别

日志保存在 logs/inference.log。

CPU-NPU 精度一致性结果

指标数值
max_abs_error0.000134
mean_abs_error0.000004
relative_error0.0090%
cosine_similarity1.000000
threshold1.0%
结果PASS

Benchmark 结果

指标数值
平均延迟858.12 ms
最小延迟833.70 ms
最大延迟894.06 ms
P50853.82 ms
P90885.47 ms
P95889.77 ms
音频时长5.55 s
RTF0.1547

工程结构

.
├── assets/
│   └── test.wav
├── logs/
│   ├── inference.log
│   ├── eval_consistency.log
│   ├── benchmark.log
│   └── env_check.log
├── screenshots/
│   ├── self_verification.txt
│   └── self_verification.png
├── model_utils.py
├── inference.py
├── eval_consistency.py
├── benchmark.py
├── capture_cpu.py
├── capture_npu.py
├── requirements.txt
├── .gitignore
└── README.md

运行说明

  1. 安装依赖:pip install -r requirements.txt
  2. 运行推理:python inference.py
  3. 运行一致性验证:python eval_consistency.py
  4. 运行性能测试:python benchmark.py

标签

#NPU #Ascend #ASR #Paraformer #FunASR