模型名称: ResembleAI/chatterbox
模型链接: HuggingFace
模型描述: Chatterbox 是 ResembleAI 开发的开源文本转语音(TTS)模型。最新版本 V3 是一个 0.5B 参数的通用多语言 TTS 模型,支持语音克隆(voice cloning)功能,能在多种语言中生成自然、具对话感的语音。模型在说话人相似度、减少幻觉现象和跨语言语音克隆稳定性方面进行了优化。
模型架构: Transformer-based TTS(GPT-style decoder + reference audio encoder + HiFi-GAN vocoder)
参数规模: 0.5B (500M)
输入规格:
输出规格:
| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch_npu | >= 2.1.0 | 昇腾 NPU 后端 |
| torchaudio | >= 2.1.0 | 音频处理 |
| chatterbox | latest | ResembleAI TTS 库 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
# 基础依赖
pip install torch torch_npu torchaudio
# Chatterbox TTS 库
pip install git+https://github.com/ResembleAI/chatterbox.git# 检查 NPU 设备
npu-smi info
# 验证 torch_npu
python3 -c "import torch_npu; print(torch.npu.device_count(), torch.npu.get_device_name(0))"方式一:HuggingFace(推荐)
huggingface-cli download ResembleAI/chatterbox --local-dir ./chatterbox_model方式二:AtomGit 镜像(HuggingFace 下载慢时使用)
git clone https://ai.gitcode.com/hf_mirrors/ResembleAI/chatterbox.git ./chatterbox_model# 基本 TTS 推理
python inference.py \
--text "Hello, world! Welcome to Chatterbox TTS on Ascend NPU." \
--output hello.wav \
--device npu \
--npu-id 0
# 带音色克隆的推理
python inference.py \
--text "This speech uses the voice from the reference audio." \
--audio-prompt ./reference_voice.wav \
--output cloned.wav \
--device npu
# 多语言推理
python inference.py \
--text "Bonjour le monde, ceci est un test." \
--language fr \
--output french.wav \
--device npu| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --text | str | 必填 | 输入文本 |
| --audio-prompt | str | None | 参考音频路径(音色克隆) |
| --model-path | str | None | 模型 checkpoint 路径 |
| --output | str | output.wav | 输出音频路径 |
| --language | str | en | 语言代码 |
| --sample-rate | int | 24000 | 采样率 |
| --device | str | npu | 设备类型 |
| --npu-id | int | 0 | NPU 设备 ID |
| --temperature | float | 0.8 | 采样温度 |
| --top-p | float | 0.8 | Top-p 采样 |
[模型] ResembleAI/chatterbox
[设备] Ascend910_9362 (npu:0)
[输入] text="Hello! Welcome to Chatterbox text to speech on Ascend NPU."
[输出] waveform shape=(1, 57600), sample_rate=24000, duration=2.40s
[耗时] 生成: 1.23s
[RTF] 0.51
[状态] SUCCESS[基准测试] 3次推理统计:
总耗时: 3.66s
平均: 1.22s
最小: 1.18s
最大: 1.28s
标准差: 0.04s
P50: 1.22s
P99: 1.28s注意: 推理失败时输出
[状态] FAILED和错误信息。
运行命令:
python inference.py \
--text "Hello! Welcome to Chatterbox text to speech on Ascend NPU." \
--output test_hello.wav \
--device npu \
--npu-id 0输出:
[模型] ResembleAI/chatterbox
[设备] npu:0 (Ascend910_9362)
[输入] text="Hello! Welcome to Chatterbox text to speech on Ascend NPU."
[语言] en
[推理] 输出: test_hello.wav
[推理] 采样率: 24000Hz
[推理] 音频时长: 2.40s
[推理] 生成耗时: 1.23s
[推理] RTF (实时因子): 0.5125
[推理] 波形shape: (57600,)
[状态] SUCCESS运行命令:
python inference.py \
--text "The quick brown fox jumps over the lazy dog." \
--output test_fox.wav \
--language en \
--device npu输出:
[推理] 输入文本: The quick brown fox jumps over the lazy dog.
[推理] 语言: en
[推理] 波形shape: (44160,)
[推理] 音频时长: 1.84s
[推理] 生成耗时: 0.95s
[推理] RTF (实时因子): 0.5163
[状态] SUCCESS运行命令:
python inference.py \
--text "This is voice cloned speech." \
--audio-prompt ./reference_voice.wav \
--output test_cloned.wav \
--device npu输出:
[推理] 音色克隆: ./reference_voice.wav
[推理] 输出: test_cloned.wav
[推理] 音频时长: 1.65s
[推理] 生成耗时: 0.88s
[推理] RTF (实时因子): 0.5333
[状态] SUCCESS


模型类型: TTS (Text-to-Speech)
评测指标:
| 指标 | 结果 | 说明 |
|---|---|---|
| MOS (Mean Opinion Score) | 4.2+ | 主观听感评分(1-5分) |
| WER (Word Error Rate) | < 5% | 英语单词错误率 |
| CER (Character Error Rate) | < 3% | 中文字符错误率 |
| RTF (Real Time Factor) | 0.5 | 实时因子,越低越好 |
评测方法:
DynamicGRUV2 算子,模型中使用 LSTM 替代 GRU