#NPU
| 属性 | 值 |
|---|---|
| 模型名称 | AbelZimba/whisper-bemba-stt |
| 任务类型 | automatic-speech-recognition |
| 模型架构 | WhisperForConditionalGeneration |
| Backend | transformers |
| 来源 | HuggingFace |
| 模型权重URL | https://huggingface.co/AbelZimba/whisper-bemba-stt |
基于 OpenAI Whisper 微调的 Bemba 语语音识别模型,在 Ascend 910B NPU 上完成适配。
| 属性 | 值 |
|---|---|
| NPU | Ascend910_9362 |
| CANN | 8.5.1 |
| Python | 3.11.14 |
| PyTorch | 2.9.0+cpu |
| torch-npu | 2.9.0.post1 |
| transformers | 4.57.6 |
| soundfile | 0.13.1 |
| numpy | 1.26.4 |
pip install -r requirements.txtimport os
os.environ['HF_ENDPOINT']='https://hf-mirror.com'
from huggingface_hub import snapshot_download
model_dir = snapshot_download(repo_id="AbelZimba/whisper-bemba-stt", local_dir="./model_cache/whisper-bemba-stt", max_workers=1)下载后,processor 与 model 均从本地 model_dir 加载,使用 local_files_only=True 确保离线加载。
export MODEL_DIR=./model_cache/whisper-bemba-stt
python inference.py /path/to/test.wav
python inference.py --audio /path/to/test.wav| 属性 | 值 |
|---|---|
| NPU 设备 | Ascend910_9362 |
| torch.npu.is_available() | True |
| 推理设备 | npu:0 |
| 模型参数设备 | npu:0 |
| 输入 Tensor 设备 | npu:0 |

| 属性 | 值 |
|---|---|
| 测试音频 | ./test.wav (4.00s, 16kHz, mono) |
| 转写结果 | [звук висок] |
| 推理耗时 | ~0.50s (首次) / ~0.136s (平均) |
| 设备 | npu:0 (Ascend910_9362) |
| 状态 | PASS |
真实 NPU 推理输出:
Model: AbelZimba/whisper-bemba-stt
NPU device: Ascend910_9362
Device: npu:0
Model param device: npu:0 dtype: torch.float32
Audio loaded: shape=(64000,), sr=16000, duration=4.00s
Input input_features device: npu:0 shape: torch.Size([1, 80, 3000]) dtype: torch.float32
Inference time: 0.504s
Transcription: [звук висок]
Status: PASS
| 指标 | 值 |
|---|---|
| avg | 0.136s |
| p50 | 0.136s |
| min | 0.134s |
| max | 0.143s |
| 首次推理 | 0.504s |
| dtype | float32 |
| device | npu:0 |
| 指标 | 值 |
|---|---|
| CPU 转写 | [звук висок] |
| NPU 转写 | [звук висок] |
| 文本一致 | 完全一致 |
| Encoder hidden cosine | 1.0001 |
| Encoder hidden L1 diff | 0.004437 |
| 结论 | PASS |
