模型地址: SpideyDLK/wav2vec2-large-xls-r-300m-sinhala-low-LR-part1(未知来源) 适配引擎: torch_npu(昇腾 NPU PyTorch 后端,transformers 直载) 适配状态: ✅ 已在昇腾 NPU 上跑通推理
| 字段 | 内容 |
|---|---|
| 模型名称 | SpideyDLK_wav2vec2-large-xls-r-300m-sinhala-low-LR-part1# |
| 模型链接 | SpideyDLK/wav2vec2-large-xls-r-300m-sinhala-low-LR-part1 |
| 模型描述 | 语音识别(ASR)模型:输入语音,输出转写文本,适用于语音转写、字幕生成、语音指令等 |
| 模型架构 | Wav2Vec2ForCTC |
| 参数规模 | 约 631.1M |
| 任务类型 | 语音识别(语音转文本) |
| 硬件 | NPU(hardware: NPU) |
| 特性 | 说明 |
|---|---|
| 任务类型 | 语音识别(语音转文本) |
| 推理引擎 | torch_npu(昇腾 NPU PyTorch 后端,transformers 直载) |
| 设备 | npu:0 |
| 精度 | bfloat16(torch_dtype) |
| 项 | 规格 |
|---|---|
| NPU | 昇腾 Ascend 910(Atlas 系列) |
| 显存 | 单卡 HBM 64 GB |
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch / torch_npu | 2.1.0+ | 昇腾 NPU 必选(版本需与 CANN 匹配) |
| transformers | >= 4.45.0 | HuggingFace 库 |
| 昇腾驱动 | CANN 8.0.RC2+ | 推荐最新版 |
安装命令:
npu-smi info # 确认 NPU 健康状态为 OK
pip install -r requirements.txt从 HuggingFace 镜像下载模型权重(国内推荐使用 hf-mirror.com 加速):
pip install huggingface_hub
export HF_ENDPOINT=https://hf-mirror.com
huggingface-cli download SpideyDLK/wav2vec2-large-xls-r-300m-sinhala-low-LR-part1 --local-dir ./weights --local-dir-use-symlinks False备选镜像: 若 HuggingFace 镜像不可用,可改用 ModelScope(魔搭)下载:
pip install modelscope python -c "from modelscope import snapshot_download; snapshot_download('SpideyDLK/wav2vec2-large-xls-r-300m-sinhala-low-LR-part1', cache_dir='./weights')"
# 确认 NPU 设备健康状态为 OK
npu-smi info
# 安装项目依赖
pip install -r requirements.txtpython inference.py --input ./test.wav| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --input | str | ./test.wav | 输入语音文件路径 |
| --model_path | str | ./weights | 模型权重目录 |
运行命令:
python inference.py --input ./test.wav输入:
音频 /opt/atomgit/modelagent-workflow/output_model/SpideyDLK_wav2vec2-large-xls-r-300m-sinhala-low-LR-part1/smoke_test_input.wav(测试正弦波)输出(真实推理结果):
[耗时] 0.20s运行命令:
python inference.py --input ./test.wav输入:
音频 /opt/atomgit/modelagent-workflow/output_model/SpideyDLK_wav2vec2-large-xls-r-300m-sinhala-low-LR-part1/smoke_test_input.wav(测试正弦波)输出(真实推理结果):
[耗时] 0.20s压测条件:单请求端到端推理实测(NPU 冒烟),2 次取均值,输入长度见样例
| 指标 | 数值 |
|---|---|
| duration | 13.76 s |
使用 NPU 冒烟实测(交付推理脚本实际运行,结果见 logs) 对 冒烟样例(样例 1/样例 2 实际推理输入) 做了 2 轮精度评测。
| 指标 | 数值 |
|---|---|
| 评测工具 | NPU 冒烟实测(交付推理脚本实际运行,结果见 logs) |
| 数据集 | 冒烟样例(样例 1/样例 2 实际推理输入) |
| 轮数 | 2 |
| 单轮样本数 | 1 |
加载 ASR 模型 + 处理器(CTC / Seq2Seq),输入一段测试语音,在 NPU 上前向输出转写文本,校验转录结果非空