weixin_62994174/Fun-ASR-MLT-Nano-2512
模型介绍文件和版本Pull Requests讨论分析
下载使用量0

Fun-ASR-MLT-Nano-2512

NPU Ascend PyTorch FunASR ModelScope

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 适配

环境要求

组件版本
CANN8.5.1
torch2.x
torch_npu2.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.mp30.503s7.169s14.24 倍
en.mp32.180s10.689s4.90 倍
ja.mp31.053s12.739s12.10 倍
ko.mp30.820s9.502s11.59 倍
yue.mp30.584s7.680s13.14 倍
平均值1.028s9.556s11.20 倍

环境详情

项目详情
NPU 型号Ascend 910B(Ascend910_9362)
NPU 数量2
CANN 版本8.5.1
Python3.11
torch_npu2.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 #模型适配