v
v50_/openai-whisper-base-ASR-NPU
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

openai/whisper-base on Ascend NPU - 语音识别 (Automatic Speech Recognition)

1. 简介

本项目将 openai/whisper-base 语音识别 (Automatic Speech Recognition)模型适配到华为昇腾 NPU(Ascend910B4-1)上运行。

  • 原始模型:openai/whisper-base
  • 模型类型:语音识别 (Automatic Speech Recognition)
  • 适配方式:ModelScope / HuggingFace snapshot_download 下载权重,HuggingFace pipeline 推理
  • 运行设备:单卡 Ascend NPU

2. 验证环境

  • NPU: Ascend910B4-1
  • torch: 2.7.1+cpu
  • torch_npu: 2.7.1.post4
  • transformers: transformers.version

安装依赖:

pip install -r requirements.txt

3. 推理运行

python inference.py

推理输出:

Input: assets/test_audio.wav (7.36s)
Output:  The quick brown fox jumps over the lazy dog. This is a test of automatic speech recognition.
Status: SUCCESS

4. 精度验证

python eval_accuracy.py

CPU 与 NPU 输出一致性验证:

指标数值
relative_error0.00%
cosine_similarity1.000000

CPU 与 NPU 输出一致性验证通过。

5. 性能参考

python benchmark.py
指标数值
Avg latency15241 ms

6. 精度评测说明

本项目包含单样本 smoke consistency 验证,非完整数据集评估。

7. 项目文件

文件说明
inference.pyNPU 推理脚本
eval_accuracy.pyCPU-NPU 精度一致性验证脚本
benchmark.py性能基准测试脚本
model_utils.py模型下载工具
logs/inference.log推理结果日志
logs/accuracy.log精度验证日志
logs/benchmark.log性能测试日志
assets/test_audio.wav测试音频

8. 注意事项

  • 使用 HuggingFace Transformers pipeline 进行推理
  • CPU-NPU cosine_similarity >= 0.99