模型地址: ai4bharat/indic-parler-tts(ModelScope(魔搭)) 适配引擎: torch_npu(昇腾 NPU PyTorch 后端,transformers 直载) 适配状态: ✅ 已在昇腾 NPU 上跑通推理
| 字段 | 内容 |
|---|---|
| 模型名称 | ai4bharat_indic-parler-tts# |
| 模型链接 | ai4bharat/indic-parler-tts |
| 模型描述 | 语音合成(TTS)模型:输入文本,输出语音波形(wav),适用于文本转语音、有声内容生成等 |
| 模型架构 | ParlerTTSForConditionalGeneration |
| 参数规模 | 约 1.9B |
| 任务类型 | 语音合成(文本转语音) |
| 硬件 | 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 ai4bharat/indic-parler-tts --local-dir ./weights --local-dir-use-symlinks False备选镜像: 若 HuggingFace 镜像不可用,可改用 ModelScope(魔搭)下载:
pip install modelscope python -c "from modelscope import snapshot_download; snapshot_download('ai4bharat/indic-parler-tts', cache_dir='./weights')"
# 确认 NPU 设备健康状态为 OK
npu-smi info
# 安装项目依赖
pip install -r requirements.txtpython inference.py --input "你好,欢迎使用昇腾NPU语音合成。" --output ./output.wav| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --input | str | - | 输入文本 |
| --model_path | str | ./weights | 模型权重目录 |
| --output | str | ./output.wav | 输出语音文件路径 |
运行命令:
python inference.py --input "你好,欢迎使用昇腾NPU语音合成。" --output ./output.wav输入:
Text: "Hello, welcome to speech synthesis on Ascend NPU." / Description: "A female speaker with clear voice."输出(真实推理结果):
[结果] 音频 3.19s, 140800 samples, 44100Hz运行命令:
python inference.py --input "你好,欢迎使用昇腾NPU语音合成。" --output ./output.wav输入:
Text: "欢迎使用昇腾NPU语音合成。" / Description: "A male speaker with calm voice."输出(真实推理结果):
[结果] 音频 3.19s, 140800 samples压测条件:单请求端到端推理实测(NPU 冒烟),1 次
| 指标 | 数值 |
|---|---|
| duration | 3.19 s |
| sampling_rate | 44100 Hz |
| 指标 | 数值 |
|---|---|
| 评测工具 | NPU 冒烟实测(交付推理脚本实际运行) |
| 数据集 | 冒烟样例(文本+描述输入) |
| 指标 | 音频生成成功,3.19s 语音 |
按模型加载方式(Coqui TTS / F5-TTS 等)加载模型,输入一段中文文本,在 NPU 上合成语音 wav,校验输出文件非空且可播放