CuteTTS.AXERA
AX650 上的 0.2B 连续隐变量自回归 TTS:zero-shot 音色克隆 · 24 kHz · 10 个 axmodel 全 NPU 推理
真流式(音频级,非切句):AR 循环不停,VAE 用带卷积状态的解码器逐 patch 输出, 每 160 ms 一包、首包 TTFT 0.6~0.8 s(缓存参考音色后 0.18 s);同时保留非流式整句模式。 C++ 流式 RTF 0.39
0.54 / 非流式 0.310.51。
- HuggingFace: https://huggingface.co/HY-2012/CuteTTS.AXERA
- GitHub(源码 + 转换脚本 + C++): https://github.com/ZY-2012/CuteTTS.AXERA
- 原始模型: https://huggingface.co/OPPOer/CuteTTS-distill
目录
模型简介
CuteTTS 用「连续 latent 自回归 + 扩散头 + 因果 VAE」代替离散 codec token: LM 每步预测一个 token,4 步蒸馏扩散头生成 2 帧 64 维 latent(≈160 ms 音频), VAE 解码成 24 kHz 波形。本仓库量化的是 CuteTTS-distill。
| 子图 | 作用 |
|---|---|
vae_enc |
参考音频 → 64 维 latent(5 s) |
spk_body |
log-mel → 音色向量(ECAPA 主干,BN/linear 在 host) |
locenc_step |
latent patch → LM embedding |
lm_prefill |
7 层 Qwen3 前缀(256 token,输出 KV cache) |
lm_decode |
单 token 解码(384 长度 KV cache) |
dit_step |
单步 Euler 速度场(host 循环 4 步) |
vae_dec_l{64,128,256} |
latent → 24 kHz 波形(按长度分桶,非流式) |
vae_dec_stream |
带卷积状态的流式解码(2 latent = 160 ms 一包) |
模型转换
For those who are interested in model conversion, you can try to export axmodel through:
- The repo of AXera Platform, where you can get the detailed guide.
- Pulsar2 Link, How to Convert ONNX to axmodel
完整转换脚本(ONNX 导出 / 真实语音校准 / Pulsar2 配置):ZY-2012/CuteTTS.AXERA/model_convert
支持平台
- AX650N / AX8850
上板部署
- 以 root 权限登陆 AX650N 板卡设备
- 已验证设备:AX650N DEMO Board
目录结构
CuteTTS.AXERA/
├── bin/cutetts_ax650 # C++ 推理可执行文件
├── models/
│ ├── *.axmodel # 9 个子图
│ └── assets/ # embedding 表、mel 滤波器、BN/linear、tokenizer
├── python/
│ ├── cutetts_ax/ # numpy-only SDK
│ └── demo.py
├── samples/
│ ├── reference*.wav # 参考音色
│ └── listen/*.wav # 板端生成样例
├── config.json
├── run_ax650.sh # 一键脚本(默认 C++)
└── setup.sh
快速开始(AX650 板端)
下载整仓库到板端,在包根目录运行:
bash setup.sh
# C++(默认,最快)
bash run_ax650.sh "The voice generated by this model sounds amazing!" samples/reference.wav out.wav
# 真流式(每 160 ms 一包,首包 ≈0.7 s)
bash run_ax650.sh "The voice generated by this model sounds amazing!" samples/reference.wav out.wav --stream
# Python SDK(流式 / 非流式)
bash run_ax650.sh "今天天气很好,我们一起去公园散步吧。" samples/reference.wav zh.wav --python --stream
# 调 CFG / 随机种子 / 最长 patch 数(1 patch ≈ 160 ms)
bash run_ax650.sh "Hello from AX650!" samples/reference.wav en.wav --cfg 2.0 --seed 42 --max-new 128
参考音频 ≤ 5 s;单次生成 ≤ 20.5 s;输出 24 kHz 单声道。
结果
| 用例 | 文本 | 参考音色 | 非流式 | 流式(160 ms/包) | 板端 ASR |
|---|---|---|---|---|---|
| en_default | The voice generated by this model sounds … | 默认英文参考音色 | ▶ | ▶ | The voice generated by this model sounds amazing. |
| en_long | Hello, this is a test of the CuteTTS text… | 长句(17 词) | ▶ | ▶ | Hello, this is a test of the Q TTs test to speech system running on the8650 neural processing. |
| zh_default | 今天天气很好,我们一起去公园散步吧。 | 中文参考音色(zh_6s) | ▶ | ▶ | 今天天气很好,我们一起去公园散步吧。 |
| en_other_voice | Quick brown fox jumps over the lazy dog. | 另一段参考音色(en_16k) | ▶ | ▶ | Quick brown fox jumps over the lazy dog. |
| en_xlong | The quick brown fox jumps over the lazy d… | 默认英文参考音色(10.6 s,走 256 桶) | ▶ | ▶ | …carries a scent of fresh flowers across across the quiet meadow… morning song. |
推理速度
流式 vs 非流式(同一组 axmodel):
| 模式 | 实现 | 音频 | TTFT | 总耗时 | RTF | 出包间隔 |
|---|---|---|---|---|---|---|
| 流式 | C++ | 3.04 s | 0.69 s | 1.64 s | 0.541 | 160 ms |
| 流式 | Python | 2.88 s | 0.79 s | 1.90 s | 0.660 | 160 ms |
| 非流式 | C++ | 3.04 s | 1.54 s | 1.54 s | 0.508 | — |
| 非流式 | Python | 2.88 s | 1.61 s | 1.61 s | 0.560 | — |
10.2 s 长句:流式 C++ TTFT 0.59 s / 总 3.95 s / RTF 0.386,Python TTFT 0.80 s / 总 5.06 s / RTF 0.479。
参考音色缓存后(同一参考音频反复合成),Python TTFT 可低至 0.18 s。
指标定义
- RTF(Real-Time Factor)= 总耗时 / 音频时长,越小越好;
RTF < 1表示合成快于实时。 - TTFT(Time To First Token,首包时延)= 发起请求到拿到第一段音频的时间。 流式下 = 参考特征提取 + 1 个 AR patch + 流式解码;非流式下 = 整句端到端耗时。
流式实现(真流式,不是切句)
- AR 循环只跑一次、latent 连续产生;
vae_dec_stream.axmodel把解码器 31 个因果卷积的 左侧上下文做成 18 个显式状态张量(共 0.46 MB),每来 2 个 latent(160 ms)解码一次并输出。 - 与离线解码对比:本机 fp32 下逐样本一致(cos 1.0000000);板端量化后 SNR 11.3 dB、 ASR 逐词一致、底噪指标与离线持平。
--windowed可切到「128-latent 滑动窗」精确模式(与离线逐样本一致,TTFT 1.3 s)。
参考
- 原始模型:https://huggingface.co/OPPOer/CuteTTS-distill
- CuteTTS 官方代码 / 论文:https://github.com/OPPO-Mente-Lab/CuteTTS
- Pulsar2 文档:https://pulsar2-docs.readthedocs.io
- AXERA 开源仓库:https://github.com/AXERA-TECH
License
Apache-2.0。上游 CuteTTS(OPPO/Fudan)及 Qwen3、DAC 组件遵循其各自许可证。
- Downloads last month
- 13
Model tree for HY-2012/CuteTTS.AXERA
Base model
OPPOer/CuteTTS-distill