Views
No views yet

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 "哇, 这个模型居然在RK3588这个辣鸡SoC上也能完美运行!" --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 "哇, 这个模型居然在RK3588这个辣鸡SoC上也能完美运行!" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234
2
3I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
4I rkllm: loading rkllm model from ./base_lm.rkllm
5I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 1, target_platform: RK3588, model_dtype: FP16
6I rkllm: Enabled cpus: [4, 5, 6, 7]
7I rkllm: Enabled cpus num: 4
8I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
9I rkllm: loading rkllm model from ./residual_lm.rkllm
10I rkllm: rkllm-toolkit version: 1.2.2, max_context_limit: 4096, npu_core_num: 3, target_platform: RK3588, model_dtype: FP16
11I rkllm: Enabled cpus: [4, 5, 6, 7]
12I rkllm: Enabled cpus num: 4
13[time] vae_encode_0: 1502.91 ms
14[time] vae_encode_38400: 1443.79 ms
15[time] vae_encode_76800: 1418.36 ms
16[time] locenc_0: 820.25 ms
17[time] locenc_64: 814.78 ms
18[time] locenc_128: 815.60 ms
19[time] base_lm initial: 549.21 ms
20[time] fsq_init_0: 5.34 ms
21[time] fsq_init_64: 3.95 ms
22[time] fsq_init_128: 4.17 ms
23[time] residual_lm initial: 131.22 ms
24gen_loop: 0%| | 0/2000 [00:00<?, ?it/s][time] lm_to_dit: 1.26 ms
25[time] res_to_dit: 1.01 ms
26100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 60.13it/s]
27[time] locenc_step: 16.43 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 61.20it/s]
28gen_loop: 0%| | 1/2000 [00:00<09:43, 3.42it/s][time] lm_to_dit: 0.75 ms
29[time] res_to_dit: 0.55 ms
30100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 63.99it/s]
31[time] locenc_step: 15.93 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.27it/s]
32gen_loop: 0%| | 2/2000 [00:00<09:25, 3.53it/s][time] lm_to_dit: 0.74 ms
33
34...
35
36[time] res_to_dit: 0.59 ms
37100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 64.19it/s]
38[time] locenc_step: 15.73 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.34it/s]
39gen_loop: 6%|████▎ | 123/2000 [00:34<08:47, 3.56it/s][time] lm_to_dit: 0.76 ms
40[time] res_to_dit: 0.56 ms
41100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 64.08it/s]
42[time] locenc_step: 15.82 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.43it/s]
43gen_loop: 6%|████▎ | 123/2000 [00:34<08:47, 3.56it/s]
44[time] vae_decode_0: 1153.02 ms
45[time] vae_decode_60: 1102.36 ms
46[time] vae_decode_120: 1105.00 ms
47[time] vae_decode_180: 1105.60 ms
48[time] vae_decode_240: 1082.36 ms
49Saved: rknn_output.wavpip 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, this model 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 "哇, 这个模型居然在RK3588这个辣鸡SoC上也能完美运行!" --prompt-audio basic_ref_zh.wav --prompt-text "对,这就是我,万人敬仰的太乙真人。" --output rknn_output.wav --cfg-value 2.0 --inference-timesteps 10 --seed 1234
2
3I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
4I rkllm: loading rkllm model from ./base_lm.rkllm
5I rkllm: rkllm-toolkit version: 1.2.3, max_context_limit: 4096, npu_core_num: 1, target_platform: RK3588, model_dtype: FP16
6I rkllm: Enabled cpus: [4, 5, 6, 7]
7I rkllm: Enabled cpus num: 4
8I rkllm: rkllm-runtime version: 1.2.3, rknpu driver version: 0.9.8, platform: RK3588
9I rkllm: loading rkllm model from ./residual_lm.rkllm
10I rkllm: rkllm-toolkit version: 1.2.2, max_context_limit: 4096, npu_core_num: 3, target_platform: RK3588, model_dtype: FP16
11I rkllm: Enabled cpus: [4, 5, 6, 7]
12I rkllm: Enabled cpus num: 4
13[time] vae_encode_0: 1502.91 ms
14[time] vae_encode_38400: 1443.79 ms
15[time] vae_encode_76800: 1418.36 ms
16[time] locenc_0: 820.25 ms
17[time] locenc_64: 814.78 ms
18[time] locenc_128: 815.60 ms
19[time] base_lm initial: 549.21 ms
20[time] fsq_init_0: 5.34 ms
21[time] fsq_init_64: 3.95 ms
22[time] fsq_init_128: 4.17 ms
23[time] residual_lm initial: 131.22 ms
24gen_loop: 0%| | 0/2000 [00:00<?, ?it/s][time] lm_to_dit: 1.26 ms
25[time] res_to_dit: 1.01 ms
26100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 60.13it/s]
27[time] locenc_step: 16.43 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 61.20it/s]
28gen_loop: 0%| | 1/2000 [00:00<09:43, 3.42it/s][time] lm_to_dit: 0.75 ms
29[time] res_to_dit: 0.55 ms
30100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 63.99it/s]
31[time] locenc_step: 15.93 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.27it/s]
32gen_loop: 0%| | 2/2000 [00:00<09:25, 3.53it/s][time] lm_to_dit: 0.74 ms
33
34...
35
36[time] res_to_dit: 0.59 ms
37100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 64.19it/s]
38[time] locenc_step: 15.73 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.34it/s]
39gen_loop: 6%|████▎ | 123/2000 [00:34<08:47, 3.56it/s][time] lm_to_dit: 0.76 ms
40[time] res_to_dit: 0.56 ms
41100%|████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:00<00:00, 64.08it/s]
42[time] locenc_step: 15.82 ms████████████████████████████████████▍ | 7/10 [00:00<00:00, 67.43it/s]
43gen_loop: 6%|████▎ | 123/2000 [00:34<08:47, 3.56it/s]
44[time] vae_decode_0: 1153.02 ms
45[time] vae_decode_60: 1102.36 ms
46[time] vae_decode_120: 1105.00 ms
47[time] vae_decode_180: 1105.60 ms
48[time] vae_decode_240: 1082.36 ms
49Saved: rknn_output.wav