YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

ZipVoice.AXERA

ZipVoice AXERA 板端 & AXCL 算力卡推理 demo。

功能

  • 支持中文和英文语音生成。
  • 支持语音克隆。
  • 支持 ZipVoice、ZipVoice Distill
  • 支持 C++ 和 Python 推理
  • 支持 AX650、AX630C

模型说明

ZipVoice Distill 是 ZipVoice 的蒸馏版本,主要优势是在较小性能损失下提升推理速度。

性能对比

Distill 模型 (num_step=4)

场景 音频时长 Python AX650
耗时 RTF
C++ AX650
耗时 RTF
C++ AXCL
耗时 RTF
Python AX630C
耗时 RTF
C++ AX630C
耗时 RTF
中文句子 6.41s 1.992s/0.311 1.057s/0.165 0.918s/0.143 10.296s/1.606 4.650s/0.725
中文段落 44.97s 13.457s/0.301 7.357s/0.164 6.443s/0.143 71.574s/1.600 32.590s/0.725
英文句子 6.41s 2.045s/0.319 1.067s/0.166 0.919s/0.143 10.686s/1.667 4.654s/0.726
英文段落 59.16s 19.715s/0.305 10.529s/0.178 9.207s/0.156 106.183s/1.640 46.541s/0.787

普通模型 (num_step=10)

场景 音频时长 Python AX650 (耗时/RTF) C++ AX650 (耗时/RTF) C++ AXCL (耗时/RTF)
中文句子 6.41s 5.781s / 0.902 5.709s / 0.891 5.452s / 0.850
中文段落 44.97s 40.292s / 0.901 39.714s / 0.883 38.138s / 0.848
英文句子 6.41s 5.711s / 0.891 5.693s / 0.888 5.447s / 0.850
英文段落 59.16s 62.161s / 0.960 56.759s / 0.957 54.451s / 0.920

模型转换

模型量化参考:

支持平台

目录结构

ZipVoice.AXERA/
├── assets/
│   ├── moss_prompts/
│   └── paragraphs/
├── models/
│   ├── zipvoice_ax650/
│   ├── zipvoice_distill_ax650/
│   └── zipvoice_distill_ax630C/
├── resources/
│   ├── vocos-mel-24khz/
│   └── zipvoice_hf/
├── cpp/                         # C++ 源码 (AXERA & AXCL)
├── scripts/
├── infer_zipvoice_axera.py      # Python 推理入口
├── run_ax650.sh                 # AX650 板端
├── run_ax630c.sh                # AX630C 板端
├── run_axcl.sh                  # AXCL 算力卡
├── requirements.txt
└── README.md

Python

环境

安装 pyaxengine: pyaxengine Releases 下载对应版本安装:

pip3 install axengine-x.x.x-py3-none-any.whl

安装依赖:

conda create -n ZipVoice python=3.10
conda activate ZipVoice
pip3 install -r requirements.txt

推理命令

进入目录:

cd ZipVoice.AXERA

AX650 ZipVoice

中文句子:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_ax650 \
  --text "今天午后天气很好,我打开窗户,听见远处有人聊天,水杯也轻轻晃了一下。" \
  --prompt-text "不管怎么样我和汤姆还是要感谢贝尔卡金的援手" \
  --prompt-wav assets/moss_prompts/zh_1_4p5s.wav \
  --output-wav outputs/zh_sentence_ax650.wav \
  --seed 42

推理结果:

推理耗时: 5.781s
生成语音时长: 6.411s
RTF: 0.9018

音频:outputs/zh_sentence_ax650.wav
提示音:assets/moss_prompts/zh_1_4p5s.wav

英文句子:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_ax650 \
  --text "This morning, a small train left the station, carrying sleepy passengers toward a bright coastal town." \
  --prompt-text "This is almost twice the current industry production level per train." \
  --prompt-wav assets/moss_prompts/en_4_4p5s.wav \
  --output-wav outputs/en_sentence_ax650.wav \
  --seed 42

推理结果:

推理耗时: 5.711s
生成语音时长: 6.411s
RTF: 0.8909

音频:outputs/en_sentence_ax650.wav
提示音:assets/moss_prompts/en_4_4p5s.wav

中文段落:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_ax650 \
  --text-file assets/paragraphs/zh_ginkgo.txt \
  --prompt-text "不管怎么样我和汤姆还是要感谢贝尔卡金的援手" \
  --prompt-wav assets/moss_prompts/zh_1_4p5s.wav \
  --output-wav outputs/zh_long_paragraph_ax650.wav \
  --seed 42

推理结果:

推理耗时: 40.292s
生成语音时长: 44.744s
RTF: 0.9005

音频:outputs/zh_long_paragraph_ax650.wav
提示音:assets/moss_prompts/zh_1_4p5s.wav

英文段落:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_ax650 \
  --text-file assets/paragraphs/en_scavenger.txt \
  --prompt-text "This is almost twice the current industry production level per train." \
  --prompt-wav assets/moss_prompts/en_4_4p5s.wav \
  --output-wav outputs/en_long_paragraph_ax650.wav \
  --seed 42

推理结果:

推理耗时: 62.161s
生成语音时长: 64.749s
RTF: 0.9600

音频:outputs/en_long_paragraph_ax650.wav
提示音:assets/moss_prompts/en_4_4p5s.wav

AX650 ZipVoice Distill

中文句子:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_distill_ax650 \
  --text "今天午后天气很好,我打开窗户,听见远处有人聊天,水杯也轻轻晃了一下。" \
  --prompt-text "不管怎么样我和汤姆还是要感谢贝尔卡金的援手" \
  --prompt-wav assets/moss_prompts/zh_1_4p5s.wav \
  --output-wav outputs/zh_sentence_distill_ax650.wav \
  --seed 42

推理结果:

推理耗时: 1.992s
生成语音时长: 6.411s
RTF: 0.3107

音频:outputs/zh_sentence_distill_ax650.wav
提示音:assets/moss_prompts/zh_1_4p5s.wav

英文句子:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_distill_ax650 \
  --text "This morning, a small train left the station, carrying sleepy passengers toward a bright coastal town." \
  --prompt-text "This is almost twice the current industry production level per train." \
  --prompt-wav assets/moss_prompts/en_4_4p5s.wav \
  --output-wav outputs/en_sentence_distill_ax650.wav \
  --seed 42

推理结果:

推理耗时: 2.045s
生成语音时长: 6.411s
RTF: 0.3189

音频:outputs/en_sentence_distill_ax650.wav
提示音:assets/moss_prompts/en_4_4p5s.wav

中文段落:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_distill_ax650 \
  --text-file assets/paragraphs/zh_ginkgo.txt \
  --prompt-text "不管怎么样我和汤姆还是要感谢贝尔卡金的援手" \
  --prompt-wav assets/moss_prompts/zh_1_4p5s.wav \
  --output-wav outputs/zh_long_paragraph_distill_ax650.wav \
  --seed 42

推理结果:

推理耗时: 13.457s
生成语音时长: 44.744s
RTF: 0.3008

音频:outputs/zh_long_paragraph_distill_ax650.wav
提示音:assets/moss_prompts/zh_1_4p5s.wav

英文段落:

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_distill_ax650 \
  --text-file assets/paragraphs/en_scavenger.txt \
  --prompt-text "This is almost twice the current industry production level per train." \
  --prompt-wav assets/moss_prompts/en_4_4p5s.wav \
  --output-wav outputs/en_long_paragraph_distill_ax650.wav \
  --seed 42

推理结果:

推理耗时: 19.715s
生成语音时长: 64.749s
RTF: 0.3045

音频:outputs/en_long_paragraph_distill_ax650.wav
提示音:assets/moss_prompts/en_4_4p5s.wav

AX630C ZipVoice Distill

普通模型推理太慢,这边仅提供 Distill 模型,参数与 AX650 一致,仅 --model-name 改为 zipvoice_distill_ax630C

python3 infer_zipvoice_axera.py \
  --model-name zipvoice_distill_ax630C \
  --text "今天午后天气很好,我打开窗户,听见远处有人聊天,水杯也轻轻晃了一下。" \
  --prompt-text "不管怎么样我和汤姆还是要感谢贝尔卡金的援手" \
  --prompt-wav assets/moss_prompts/zh_1_4p5s.wav --seed 42

参数说明

  • --model-namezipvoice_ax650 / zipvoice_distill_ax650 / zipvoice_distill_ax630C
  • --prompt-wav:参考音频,用于控制音色,建议 3-5s。
  • --prompt-text:参考音频对应文本,必须尽量和 prompt-wav 内容一致。
  • --num-step:采样步数。默认从模型目录的 runtime_config.json 读取。
  • --max-feat-len:decoder 固定 feature 长度,当前模型均为 1024。

C++

C++ 推理实现。详见 cpp/README.md

参考

Downloads last month
77
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Collection including AXERA-TECH/ZipVoice.AXERA