模型地址: ResembleAI/chatterbox(未知来源) 适配引擎: torch_npu(昇腾 NPU PyTorch 后端,transformers 直载) 适配状态: ✅ 已在昇腾 NPU 上跑通推理
| 字段 | 内容 |
|---|---|
| 模型名称 | ResembleAI_chatterbox# |
| 模型链接 | ResembleAI/chatterbox |
| 模型描述 | 语音合成(TTS)模型:输入文本,输出语音波形(wav),适用于文本转语音、有声内容生成等 |
| 模型架构 | Transformer |
| 参数规模 | 约 53.7K |
| 任务类型 | 语音合成(文本转语音) |
| 硬件 | 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 ResembleAI/chatterbox --local-dir ./weights --local-dir-use-symlinks False备选镜像: 若 HuggingFace 镜像不可用,可改用 ModelScope(魔搭)下载:
pip install modelscope python -c "from modelscope import snapshot_download; snapshot_download('ResembleAI/chatterbox', 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输入:
你好,请介绍一下你自己。输出(真实推理结果):
[耗时] 2.43s运行命令:
python inference.py --input "你好,欢迎使用昇腾NPU语音合成。" --output ./output.wav输入:
你好,请介绍一下你自己。输出(真实推理结果):
[耗时] 3.62s压测条件:单请求端到端推理实测(NPU 冒烟),2 次取均值,输入长度见样例
| 指标 | 数值 |
|---|---|
| duration | 31.22 s |
使用 NPU 冒烟实测(交付推理脚本实际运行,结果见 logs) 对 冒烟样例(样例 1/样例 2 实际推理输入) 做了 2 轮精度评测。
| 指标 | 数值 |
|---|---|
| 评测工具 | NPU 冒烟实测(交付推理脚本实际运行,结果见 logs) |
| 数据集 | 冒烟样例(样例 1/样例 2 实际推理输入) |
| 轮数 | 2 |
| 单轮样本数 | 1 |
按模型加载方式(Coqui TTS / F5-TTS 等)加载模型,输入一段中文文本,在 NPU 上合成语音 wav,校验输出文件非空且可播放