Adapt iic/SenseVoiceSmall ASR model for Ascend NPU
当前项目代码仓暂无内容
以下内容由 AI 翻译,如有问题请 点此提交 issue 反馈
iic/SenseVoiceSmall - 昇腾NPU语音识别
模型信息
- 模型:SenseVoiceSmall(iic/SenseVoiceSmall)
- 架构:FunASR(带SAN-M transformer的非自回归编码器)
- 任务:自动语音识别
- 语言:多语言(中/英/日/粤/韩)
- 采样率:16kHz
文件说明
inference.py- 在NPU上运行语音识别推理eval_accuracy.py- 比较CPU与NPU输出精度benchmark.py- 性能基准测试model_utils.py- 模型加载工具
使用方法
# Inference
python inference.py
# Accuracy check
python eval_accuracy.py
# Benchmark
python benchmark.py
推理输出示例
Task: Automatic Speech Recognition
Model: iic/SenseVoiceSmall
Device: npu:0
Input: test_audio.wav (7.36s)
Transcript: <|en|><|EMO_UNKNOWN|><|Speech|><|withitn|>The quick brown f jumps over the lazy dog,
this is a test of automatic speech recognition.
精度验证(CPU 与 NPU)
=== CPU-NPU ASR Transcription Accuracy Check ===
model iic/SenseVoiceSmall
cpu_text <|en|><|emo_unknown|><|speech|><|withitn|>the quick brown f jumps over the la.
npu_text <|en|><|emo_unknown|><|speech|><|withitn|>the quick brown f jumps over the la.
edit_distance 0
relative_error 0.00%
exact_match 1.0
result PASS
性能
- NPU 推理:7.36 秒音频耗时约 225 毫秒(实时率 RTF=0.031)
- CPU 推理:7.36 秒音频耗时约 6257 毫秒(实时率 RTF=0.85)
- NPU 速度约为 CPU 的 28 倍