Views
No views yet
VoxCPM 是一种创新的无分词器文本转语音(TTS)系统,重新定义了语音合成的真实感。通过在连续空间中建模语音,它克服了离散标记化的局限,并实现了两项核心能力:上下文感知的语音生成和逼真的零样本语音克隆。 不同于将语音转换为离散标记的主流方法,VoxCPM 采用端到端的扩散自回归架构,直接从文本生成连续的语音表示。它基于 MiniCPM-4 主干构建,通过分层语言建模和 FSQ 约束实现了隐式的语义-声学解耦,极大地提升了表现力和生成稳定性。
| 特性 | VoxCPM | VoxCPM1.5 |
|---|---|---|
| Audio VAE 采样率 | 16kHz | 44.1kHz |
| LM Token 速率 | 12.5Hz | 6.25Hz |
| Patch 大小 | 2 | 4 |
| SFT 支持 | ✅ | ✅ |
| LoRA 支持 | ✅ | ✅ |
pip install numpy scipy soundfile tqdm transformers sentencepiece ztu-somemodelruntime-ez-rknn-asyncpython onnx_infer-rknn2.py --onnx-dir . --tokenizer-dir . --base-hf-dir . --residual-hf-dir . --text "哇, VoxCPM1.5 现在也能在 RK3588 上跑起来了。" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234--text: 要生成的文本--prompt-audio: 参考音频路径(用于语音克隆)--prompt-text: 参考音频对应的文本(使用参考音频时必填)--cfg-value: CFG引导强度,默认2.0--inference-timesteps: 扩散步数,默认10--seed: 随机种子--output: 输出音频路径1> python onnx_infer-rknn2.py --onnx-dir . --tokenizer-dir . --base-hf-dir . --residual-hf-dir . --text "哇, VoxCPM1.5 现在也能在 RK3588 上跑起来了。" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234
2I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
3I rkllm: loading rkllm model from ./base_lm.rkllm
4I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 1, target_platform: RK3588, model_dtype: FP16
5I rkllm: Enabled cpus: [4, 5, 6, 7]
6I rkllm: Enabled cpus num: 4
7I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
8I rkllm: loading rkllm model from ./residual_lm.rkllm
9I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 3, target_platform: RK3588, model_dtype: FP16
10I rkllm: Enabled cpus: [4, 5, 6, 7]
11I rkllm: Enabled cpus num: 4
12[time] vae_encode_0: 2127.35 ms
13[time] vae_encode_105840: 2057.71 ms
14[time] vae_encode_211680: 1997.43 ms
15[time] locenc_0: 1791.50 ms
16[time] locenc_64: 1782.49 ms
17[time] base_lm initial: 368.19 ms
18[time] fsq_init_0: 5.52 ms
19[time] fsq_init_64: 4.20 ms
20[time] residual_lm initial: 105.79 ms
21gen_loop: 0%| | 0/2000 [00:00<?, ?it/s][time] lm_to_dit: 1.49 ms
22[time] res_to_dit: 1.11 ms
23100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.15it/s]
24[time] locenc_step: 33.00 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.24it/s]
25gen_loop: 0%| | 1/2000 [00:00<15:33, 2.14it/s][time] lm_to_dit: 0.67 ms
26[time] res_to_dit: 0.76 ms
27100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.86it/s]
28[time] locenc_step: 31.85 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.99it/s]
29gen_loop: 0%|▏ | 2/2000 [00:00<15:18, 2.18it/s][time] lm_to_dit: 0.61 ms
30[time] res_to_dit: 0.65 ms
31100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.72it/s]
32[time] locenc_step: 32.01 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.83it/s]
33gen_loop: 2%|███▉ | 49/2000 [00:22<14:55, 2.18it/s][time] lm_to_dit: 0.88 ms
34[time] res_to_dit: 0.64 ms
35100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.72it/s]
36[time] locenc_step: 32.16 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.88it/s]
37gen_loop: 2%|███▉ | 49/2000 [00:22<15:05, 2.15it/s]
38[time] vae_decode_0: 2438.31 ms
39[time] vae_decode_60: 2372.92 ms
40[time] vae_decode_120: 2380.40 ms
41[time] vae_decode_180: 2344.88 ms
42Saved: rknn_output.wavVoxCPM is an innovative tokenizer-free Text-to-Speech (TTS) system that redefines realism in speech synthesis. By modeling speech in continuous space, it overcomes the limitations of discrete tokenization and achieves two core capabilities: context-aware speech generation and realistic zero-shot voice cloning.
Unlike mainstream approaches that convert speech into discrete tokens, VoxCPM adopts an end-to-end diffusion autoregressive architecture that directly generates continuous speech representations from text. Built on the MiniCPM-4 backbone, it achieves implicit semantic-acoustic decoupling through hierarchical language modeling and FSQ constraints, greatly enhancing expressiveness and generation stability.
| Feature | VoxCPM | VoxCPM1.5 |
|---|---|---|
| Audio VAE Sampling Rate | 16kHz | 44.1kHz |
| LM Token Rate | 12.5Hz | 6.25Hz |
| Patch Size | 2 | 4 |
| SFT Support | ✅ | ✅ |
| LoRA Support | ✅ | ✅ |
pip install numpy scipy soundfile tqdm transformers sentencepiece ztu-somemodelruntime-ez-rknn-asyncpython onnx_infer-rknn2.py --onnx-dir . --tokenizer-dir . --base-hf-dir . --residual-hf-dir . --text "Wow, VoxCPM1.5 actually runs perfectly on the RK3588 SoC!" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234--text: Text to generate--prompt-audio: Reference audio path (for voice cloning)--prompt-text: Text corresponding to the reference audio (required when using reference audio)--cfg-value: CFG guidance strength, default 2.0--inference-timesteps: Number of diffusion steps, default 10--seed: Random seed--output: Output audio path1> python onnx_infer-rknn2.py --onnx-dir . --tokenizer-dir . --base-hf-dir . --residual-hf-dir . --text "哇, VoxCPM1.5 现在也能在 RK3588 上跑起来了。" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234
2I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
3I rkllm: loading rkllm model from ./base_lm.rkllm
4I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 1, target_platform: RK3588, model_dtype: FP16
5I rkllm: Enabled cpus: [4, 5, 6, 7]
6I rkllm: Enabled cpus num: 4
7I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
8I rkllm: loading rkllm model from ./residual_lm.rkllm
9I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 3, target_platform: RK3588, model_dtype: FP16
10I rkllm: Enabled cpus: [4, 5, 6, 7]
11I rkllm: Enabled cpus num: 4
12[time] vae_encode_0: 2127.35 ms
13[time] vae_encode_105840: 2057.71 ms
14[time] vae_encode_211680: 1997.43 ms
15[time] locenc_0: 1791.50 ms
16[time] locenc_64: 1782.49 ms
17[time] base_lm initial: 368.19 ms
18[time] fsq_init_0: 5.52 ms
19[time] fsq_init_64: 4.20 ms
20[time] residual_lm initial: 105.79 ms
21gen_loop: 0%| | 0/2000 [00:00<?, ?it/s][time] lm_to_dit: 1.49 ms
22[time] res_to_dit: 1.11 ms
23100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.15it/s]
24[time] locenc_step: 33.00 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.24it/s]
25gen_loop: 0%| | 1/2000 [00:00<15:33, 2.14it/s][time] lm_to_dit: 0.67 ms
26[time] res_to_dit: 0.76 ms
27100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.86it/s]
28[time] locenc_step: 31.85 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.99it/s]
29gen_loop: 0%|▏ | 2/2000 [00:00<15:18, 2.18it/s][time] lm_to_dit: 0.61 ms
30[time] res_to_dit: 0.65 ms
31100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.72it/s]
32[time] locenc_step: 32.01 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.83it/s]
33gen_loop: 2%|███▉ | 49/2000 [00:22<14:55, 2.18it/s][time] lm_to_dit: 0.88 ms
34[time] res_to_dit: 0.64 ms
35100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 32.72it/s]
36[time] locenc_step: 32.16 ms█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████▊ | 8/10 [00:00<00:00, 32.88it/s]
37gen_loop: 2%|███▉ | 49/2000 [00:22<15:05, 2.15it/s]
38[time] vae_decode_0: 2438.31 ms
39[time] vae_decode_60: 2372.92 ms
40[time] vae_decode_120: 2380.40 ms
41[time] vae_decode_180: 2344.88 ms
42Saved: rknn_output.wav