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

facebook/wav2vec2-base-960h 在昇腾 NPU 上的应用 - 语音识别(Automatic Speech Recognition)

1. 简介

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

  • 原始模型:facebook/wav2vec2-base-960h
  • 模型类型:语音识别(Automatic Speech Recognition)
  • 适配方式:通过 ModelScope 的 snapshot_download 下载权重,使用 HuggingFace pipeline 进行推理
  • 运行设备:单卡 Ascend NPU

2. 验证环境

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

安装依赖:

pip install -r requirements.txt

3. 推理运行

python inference.py

推理输出:

Input: assets/test_audio.wav (7.36s)
Output: the quick brown fux jumps over the lazy dog this is te 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