neutts-nano-french 在昇腾 NPU 上的部署
1. 简介
French NeuTTS-Nano 是由 Neuphonic 开发的高效端侧 TTS(文本转语音)语音语言模型的法语版本,目前已完成华为昇腾 Ascend 910B4 NPU 的适配工作。
2. 验证环境
| 组件 | 版本 |
|---|
| NPU | 1 张 Ascend 910B4(32GB HBM) |
| CANN | 25.5.1 |
| torch | 2.9.0 |
| torch_npu | 2.9.0.post1+gitee7ba04 |
| neutts | 1.1.0 |
| neucodec | (随 neutts 一同安装) |
3. 快速开始
3.1 环境准备
pip install neutts soundfile
3.2 模型下载
export HF_ENDPOINT=https://hf-mirror.com
python3 -c "
import os; os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
from huggingface_hub import snapshot_download
snapshot_download('neuphonic/neutts-nano-french', local_dir='./neutts-nano-french')
"
3.3 NPU 推理
export HF_ENDPOINT=https://hf-mirror.com
python3 inference.py --text "Bonjour le monde, ceci est un test." --output output.wav
4. 功能验证
| 指标 | 数值 |
|---|
| 加载时间 | 25.2s |
| 推理时间 | 24.0s |
| 生成音频时长 | 2.8s |
| RTF | 8.59 |
| NPU 内存占用 | 3.93 GiB |
5. 精度验证
| 指标 | 数值 |
|---|
| 最大绝对误差 | 1.62e-05 |
| 平均绝对误差 | 3.35e-06 |
| 相对误差 | 0.00007% |
| Top-1 一致率 | 100.0% |
| NPU 加速比 | 40.67x |
| 精度阈值 | < 1.0% |
| 结果 | ✅ 通过 |
6. 参考资源