Fun-ASR-MLT-Nano-2512

Fun-ASR-MLT-Nano-2512 的 昇腾 Ascend NPU 适配版本,支持在华为昇腾硬件上进行高性能多语言语音识别推理。
模型信息
| 字段 | 值 |
|---|
| 模型名称 | Fun-ASR-MLT-Nano-2512 |
| 原始来源 | ModelScope / HuggingFace |
| 开发者 | 通义实验室(阿里巴巴) |
| 模型架构 | FunASRNano(SenseVoiceEncoderSmall + Qwen3-0.6B LLM + CTC 解码器) |
| 参数量 | 8亿 |
| 支持语言 | 31种语言(中文、英文、日语、韩语、粤语、越南语等) |
| 支持硬件 | 昇腾 910B NPU / NVIDIA GPU / CPU |
| 框架 | PyTorch + torch_npu + FunASR |
昇腾 NPU 适配
环境要求
| 组件 | 版本 |
|---|
| CANN | 8.5.1 |
| torch | 2.x |
| torch_npu | 2.x |
| funasr | >= 1.3.1 |
| soundfile | >= 0.13 |
| librosa | >= 0.11 |
快速开始
# Install dependencies
pip install funasr soundfile librosa
# Download model from ModelScope
pip install modelscope
modelscope download --model FunAudioLLM/Fun-ASR-MLT-Nano-2512 --local_dir ./Fun-ASR-MLT-Nano-2512
NPU 推理
import torch
import torch_npu
# Ensure NPU is available
assert torch.npu.is_available(), "NPU not available"
device = torch.device("npu:0")
# Load and run
from inference import load_model_cpu, move_model_to_npu, run_inference_npu
model, kwargs = load_model_cpu("./Fun-ASR-MLT-Nano-2512")
model_npu = move_model_to_npu(model, device)
result = run_inference_npu(
model_npu, kwargs,
wav_path="./example/zh.mp3",
language="中文",
itn=True,
)
print(result["text"])
或者直接运行:
python inference.py --wav example/zh.mp3 --language "中文"
python inference.py --all_examples # run all examples
Ascend 910B NPU 评估结果
准确性验证(NPU 与 CPU 对比)
| 测试文件 | 语言 | NPU 结果 | CPU 结果 | 字符差异 | 状态 |
|---|
| zh.mp3 | 中文 | 開放時間早上九點至下午五點。 | 開放時間早上九點至下午五點。 | 0.0000% | PASS |
| en.mp3 | 英语 | The tribal chieftain called for the boy... | The tribal chieftain called for the boy... | 0.0000% | PASS |
| ja.mp3 | 日语 | うちの中学は弁当制で... | うちの中学は弁当制で... | 0.0000% | PASS |
| ko.mp3 | 韩语 | 조금만 생각을 하면서 살면 훨씬 편할 거야. | 조금만 생각을 하면서 살면 훨씬 편할 거야. | 0.0000% | PASS |
| yue.mp3 | 粤语 | 呢幾個字都表逹唔到我想講嘅意思 | 呢幾個字都表逹唔到我想講嘅意思 | 0.0000% | PASS |
准确性:所有测试用例完全匹配,准确率达 100.00%。字符级差异为 0.0000%(低于 1% 阈值)。
性能基准测试(NPU 与 CPU 对比)
| 测试文件 | NPU 时间(平均值) | CPU 时间 | 加速比 |
|---|
| zh.mp3 | 0.503s | 7.169s | 14.24 倍 |
| en.mp3 | 2.180s | 10.689s | 4.90 倍 |
| ja.mp3 | 1.053s | 12.739s | 12.10 倍 |
| ko.mp3 | 0.820s | 9.502s | 11.59 倍 |
| yue.mp3 | 0.584s | 7.680s | 13.14 倍 |
| 平均值 | 1.028s | 9.556s | 11.20 倍 |
环境详情
| 项目 | 详情 |
|---|
| NPU 型号 | Ascend 910B(Ascend910_9362) |
| NPU 数量 | 2 |
| CANN 版本 | 8.5.1 |
| Python | 3.11 |
| torch_npu | 2.x(兼容 CANN 8.5.1) |
| 测试日期 | 2026-05-16 |
文件结构
Fun-ASR-MLT-Nano-2512/
├── inference.py # NPU-adapted inference script
├── evaluate.py # Accuracy & performance benchmark script
├── README.md # This file
├── model.py # Model architecture definition
├── model.pt # Model checkpoint (1.97GB)
├── config.yaml # Model configuration
├── configuration.json # Pipeline configuration
├── ctc.py # CTC decoder module
├── multilingual.tiktoken # CTC tokenizer vocabulary
├── tools/
│ └── utils.py # Forced alignment utilities
├── Qwen3-0.6B/ # Qwen LLM tokenizer files
│ └── tokenizer.json, vocab.json, merges.txt, config.json
└── example/ # Test audio files (5 languages)
├── zh.mp3
├── en.mp3
├── ja.mp3
├── ko.mp3
└── yue.mp3
模型架构
Audio Input (16kHz)
│
▼
WavFrontend (80-dim mel fbank, lfr_m=7, lfr_n=6)
│
▼
SenseVoiceEncoderSmall (512-dim, 50 SANM blocks, 4 heads)
│
├──► CTC Decoder (5-layer Transformer) ──► CTC Alignments
│
▼
Audio Adaptor (2-layer Transformer, 512→1024)
│
▼
Qwen3-0.6B LLM (frozen, bfloat16)
│
▼
Text Output (31 languages)
标签
#NPU #硬件NPU #昇腾 #Ascend910B #语音识别 #ASR #FunASR #多语言 #PyTorch #torch_npu #模型适配