Skip to content

[LLM:Feature] Support Qwen3-TTS-12Hz-0.6B-Base#4589

Open
huangzhengxiang wants to merge 20 commits into
alibaba:masterfrom
Embedded-AI-Systems:qwen3-tts
Open

[LLM:Feature] Support Qwen3-TTS-12Hz-0.6B-Base#4589
huangzhengxiang wants to merge 20 commits into
alibaba:masterfrom
Embedded-AI-Systems:qwen3-tts

Conversation

@huangzhengxiang

Copy link
Copy Markdown
Contributor

Description

Support Qwen3-TTS-12Hz-0.6B-Base

Module

LLM.

Exported model at huangzhengxiang/Qwen3-TTS-0.6B-Base-FP16-MNN and huangzhengxiang/Qwen3-TTS-0.6B-Base-INT8-MNN.

TTS demo at transformers/llm/engine/demo/qwen3_tts_demo.cpp. (Currently only support text to speech. Reference voice is not supported in the demo.)

Type

  • Feature

Checklist

  • Commit message follows [Module:Type] Description format
  • Code compiles without errors
  • Tested on relevant platform(s)
  • No unrelated format or style changes included

@Rye426

Rye426 commented Jul 2, 2026

Copy link
Copy Markdown

谢谢你的贡献
当我尝试自己导出4bit 的mnn模型时,出现:
python3 transformers/llm/export/llmexport.py --path Qwen3-TTS-12Hz-0.6B-Base/ --export mnn --quant_bit 4 --quant_block 128 --dst_path Qwen3-TTS-12Hz-0.6B-Base/mnn/


Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.


/bin/sh: line 1: sox: command not found
WARNING:sox:SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.

2026-07-02 19:39:27.915645554 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card3": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor"
2026-07-02 19:39:27.915713016 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card1": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card1/device/vendor"
2026-07-02 19:39:27.915733716 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card4": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card4/device/vendor"
2026-07-02 19:39:27.915750747 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card2": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card2/device/vendor"
2026-07-02 19:39:27.915768727 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card0": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor"
The module name (originally ) is not a valid Python identifier. Please rename the original module to avoid import issues.
✅ Done load pretrained model /path/Qwen3-TTS-12Hz-0.6B-Base/[ 3.62 s]
✅ Done export qwen3_tts code predictor to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx[ 0.84 s]
✅ Done export qwen3_tts codec embedder to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/codec_embedder.onnx[ 0.03 s]
✅ Done export qwen3_tts talker to ['/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/talker.onnx', '/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx', '/home/c
✅ Done convert onnx model to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn[ 1.75 s]
Load LayerNorm data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:00<00:00, 919294.92it/s]
Quant weights: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:02<00:00, 1101.03it/s]
✅ Done quant model weight to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn.weight[ 2.67 s]
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)
Aborted

然后我尝试用您给的Qwen3-TTS-0.6B-Base-INT8-MNN:
./build/qwen3_tts_demo Qwen3-TTS-0.6B-Base-INT8-MNN --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --normalize 0.95 推理时间比较长,并且只有电流声
当我的text用”你好,千问“,能够正常输出,但RTF值比较大。

@huangzhengxiang

Copy link
Copy Markdown
Contributor Author

自己导出的话需要编译MNNConvert并指定--mnnconvert的路径,预编译的MNN python包暂不支持.

@huangzhengxiang

Copy link
Copy Markdown
Contributor Author

谢谢你的贡献 当我尝试自己导出4bit 的mnn模型时,出现: python3 transformers/llm/export/llmexport.py --path Qwen3-TTS-12Hz-0.6B-Base/ --export mnn --quant_bit 4 --quant_block 128 --dst_path Qwen3-TTS-12Hz-0.6B-Base/mnn/

Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.

/bin/sh: line 1: sox: command not found WARNING:sox:SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.

2026-07-02 19:39:27.915645554 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card3": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor" 2026-07-02 19:39:27.915713016 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card1": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card1/device/vendor" 2026-07-02 19:39:27.915733716 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card4": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card4/device/vendor" 2026-07-02 19:39:27.915750747 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card2": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card2/device/vendor" 2026-07-02 19:39:27.915768727 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card0": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor" The module name (originally ) is not a valid Python identifier. Please rename the original module to avoid import issues. ✅ Done load pretrained model /path/Qwen3-TTS-12Hz-0.6B-Base/[ 3.62 s] ✅ Done export qwen3_tts code predictor to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx[ 0.84 s] ✅ Done export qwen3_tts codec embedder to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/codec_embedder.onnx[ 0.03 s] ✅ Done export qwen3_tts talker to ['/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/talker.onnx', '/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx', '/home/c ✅ Done convert onnx model to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn[ 1.75 s] Load LayerNorm data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:00<00:00, 919294.92it/s] Quant weights: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:02<00:00, 1101.03it/s] ✅ Done quant model weight to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn.weight[ 2.67 s] terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0) Aborted

然后我尝试用您给的Qwen3-TTS-0.6B-Base-INT8-MNN: ./build/qwen3_tts_demo Qwen3-TTS-0.6B-Base-INT8-MNN --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --normalize 0.95 推理时间比较长,并且只有电流声 当我的text用”你好,千问“,能够正常输出,但RTF值比较大。

预导出模型的问题我看看能否复现,来解决一下。

@huangzhengxiang

Copy link
Copy Markdown
Contributor Author

谢谢你的贡献 当我尝试自己导出4bit 的mnn模型时,出现: python3 transformers/llm/export/llmexport.py --path Qwen3-TTS-12Hz-0.6B-Base/ --export mnn --quant_bit 4 --quant_block 128 --dst_path Qwen3-TTS-12Hz-0.6B-Base/mnn/

Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.

/bin/sh: line 1: sox: command not found WARNING:sox:SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.

2026-07-02 19:39:27.915645554 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card3": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor" 2026-07-02 19:39:27.915713016 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card1": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card1/device/vendor" 2026-07-02 19:39:27.915733716 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card4": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card4/device/vendor" 2026-07-02 19:39:27.915750747 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card2": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card2/device/vendor" 2026-07-02 19:39:27.915768727 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card0": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor" The module name (originally ) is not a valid Python identifier. Please rename the original module to avoid import issues. ✅ Done load pretrained model /path/Qwen3-TTS-12Hz-0.6B-Base/[ 3.62 s] ✅ Done export qwen3_tts code predictor to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx[ 0.84 s] ✅ Done export qwen3_tts codec embedder to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/codec_embedder.onnx[ 0.03 s] ✅ Done export qwen3_tts talker to ['/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/talker.onnx', '/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx', '/home/c ✅ Done convert onnx model to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn[ 1.75 s] Load LayerNorm data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:00<00:00, 919294.92it/s] Quant weights: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:02<00:00, 1101.03it/s] ✅ Done quant model weight to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn.weight[ 2.67 s] terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0) Aborted

然后我尝试用您给的Qwen3-TTS-0.6B-Base-INT8-MNN: ./build/qwen3_tts_demo Qwen3-TTS-0.6B-Base-INT8-MNN --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --normalize 0.95 推理时间比较长,并且只有电流声 当我的text用”你好,千问“,能够正常输出,但RTF值比较大。

问题已修复,是没有加reference voice参考音频的原因。官方Demo需要添加一段声音作为参考音频才能正常生成。
现在您尝试
build-linux/qwen3_tts_demo
model/Qwen3-TTS-0.6B-Base-MNN-int8
--text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服"
64
./tts_output/
chinese
--ref_audio apps/iOS/MNNLLMChat/MNNLLMiOS/LocalBatchTest/Audios/BAC009S0764W0121.wav
--normalize 0.95

生成音频在:
./tts_output/qwen3_tts_text.wav

如果要对比 fp16,把模型路径替换成:
model/Qwen3-TTS-0.6B-Base-MNN-fp16

@Rye426

Rye426 commented Jul 6, 2026

Copy link
Copy Markdown

谢谢你的贡献 当我尝试自己导出4bit 的mnn模型时,出现: python3 transformers/llm/export/llmexport.py --path Qwen3-TTS-12Hz-0.6B-Base/ --export mnn --quant_bit 4 --quant_block 128 --dst_path Qwen3-TTS-12Hz-0.6B-Base/mnn/
Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.
/bin/sh: line 1: sox: command not found WARNING:sox:SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.

2026-07-02 19:39:27.915645554 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card3": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor" 2026-07-02 19:39:27.915713016 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card1": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card1/device/vendor" 2026-07-02 19:39:27.915733716 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card4": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card4/device/vendor" 2026-07-02 19:39:27.915750747 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card2": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card2/device/vendor" 2026-07-02 19:39:27.915768727 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card0": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor" The module name (originally ) is not a valid Python identifier. Please rename the original module to avoid import issues. ✅ Done load pretrained model /path/Qwen3-TTS-12Hz-0.6B-Base/[ 3.62 s] ✅ Done export qwen3_tts code predictor to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx[ 0.84 s] ✅ Done export qwen3_tts codec embedder to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/codec_embedder.onnx[ 0.03 s] ✅ Done export qwen3_tts talker to ['/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/talker.onnx', '/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx', '/home/c ✅ Done convert onnx model to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn[ 1.75 s] Load LayerNorm data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:00<00:00, 919294.92it/s] Quant weights: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:02<00:00, 1101.03it/s] ✅ Done quant model weight to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn.weight[ 2.67 s] terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0) Aborted
然后我尝试用您给的Qwen3-TTS-0.6B-Base-INT8-MNN: ./build/qwen3_tts_demo Qwen3-TTS-0.6B-Base-INT8-MNN --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --normalize 0.95 推理时间比较长,并且只有电流声 当我的text用”你好,千问“,能够正常输出,但RTF值比较大。

问题已修复,是没有加reference voice参考音频的原因。官方Demo需要添加一段声音作为参考音频才能正常生成。 现在您尝试 build-linux/qwen3_tts_demo model/Qwen3-TTS-0.6B-Base-MNN-int8 --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --ref_audio apps/iOS/MNNLLMChat/MNNLLMiOS/LocalBatchTest/Audios/BAC009S0764W0121.wav --normalize 0.95

生成音频在: ./tts_output/qwen3_tts_text.wav

如果要对比 fp16,把模型路径替换成: model/Qwen3-TTS-0.6B-Base-MNN-fp16

根据以上命令,这是以下输出
CPU Group: [ 1 2 3 4 ], 799999 - 1799998
CPU Group: [ 7 8 ], 799830 - 2199850
CPU Group: [ 5 6 ], 799830 - 2299829
CPU Group: [ 9 10 ], 799830 - 2499787
CPU Group: [ 0 11 ], 799830 - 2600083
The device supports: i8sdot:1, fp16:1, i8mm: 1, sve2: 1, sme2: 0
waveform shape=[1,122880] size=122880
waveform first16: 0.00023078975 0.0002876065 0.00030268927 0.00032124258 0.00024789077 2.1432717e-05 -0.00028724791 -7.7549652e-05 2.0121633e-05 -3.7976828e-05 -0.00016274943 -0.00020869241 -0.00020560113 -0.00023263895 -0.00026221521 -0.00029193162
normalize target_peak=0.95 original_peak=1 scale=0.95
waveform_normalized shape=[1,122880] size=122880
waveform_normalized first16: 0.00021925026 0.00027322618 0.00028755481 0.00030518044 0.00023549623 2.0361082e-05 -0.00027288552 -7.367217e-05 1.9115552e-05 -3.6077985e-05 -0.00015461196 -0.00019825778 -0.00019532107 -0.00022100699 -0.00024910446 -0.00027733503
saved wav: /home/cix/workspace/TTS_llama.cpp/tts_output/qwen3_tts_text.wav
Qwen3-TTS text C++ chain finished. frames=64

生成的语音不完整只有一半,把64提高到128就完整了,目前生成的时间貌似比较慢,另外可以添加一个计算rtf的功能吗?

@huangzhengxiang

Copy link
Copy Markdown
Contributor Author

谢谢你的贡献 当我尝试自己导出4bit 的mnn模型时,出现: python3 transformers/llm/export/llmexport.py --path Qwen3-TTS-12Hz-0.6B-Base/ --export mnn --quant_bit 4 --quant_block 128 --dst_path Qwen3-TTS-12Hz-0.6B-Base/mnn/
Warning: flash-attn is not installed. Will only run the manual PyTorch version. Please install flash-attn for faster inference.
/bin/sh: line 1: sox: command not found WARNING:sox:SoX could not be found!

If you do not have SoX, proceed here:
 - - - http://sox.sourceforge.net/ - - -

If you do (or think that you should) have SoX, double-check your
path variables.

2026-07-02 19:39:27.915645554 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card3": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card3/device/vendor" 2026-07-02 19:39:27.915713016 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card1": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card1/device/vendor" 2026-07-02 19:39:27.915733716 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card4": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card4/device/vendor" 2026-07-02 19:39:27.915750747 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card2": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card2/device/vendor" 2026-07-02 19:39:27.915768727 [W:onnxruntime:Default, device_discovery.cc:283 GetGpuDevices] Failed to detect devices under "/sys/class/drm/card0": device_discovery.cc:93 ReadFileContents Failed to open file: "/sys/class/drm/card0/device/vendor" The module name (originally ) is not a valid Python identifier. Please rename the original module to avoid import issues. ✅ Done load pretrained model /path/Qwen3-TTS-12Hz-0.6B-Base/[ 3.62 s] ✅ Done export qwen3_tts code predictor to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx[ 0.84 s] ✅ Done export qwen3_tts codec embedder to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/codec_embedder.onnx[ 0.03 s] ✅ Done export qwen3_tts talker to ['/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/talker.onnx', '/path/Qwen3-TTS-12Hz-0.6B-Base/mnn/onnx/code_predictor.onnx', '/home/c ✅ Done convert onnx model to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn[ 1.75 s] Load LayerNorm data: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:00<00:00, 919294.92it/s] Quant weights: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2743/2743 [00:02<00:00, 1101.03it/s] ✅ Done quant model weight to /path/Qwen3-TTS-12Hz-0.6B-Base/mnn/talker.mnn.weight[ 2.67 s] terminate called after throwing an instance of 'std::out_of_range' what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0) Aborted
然后我尝试用您给的Qwen3-TTS-0.6B-Base-INT8-MNN: ./build/qwen3_tts_demo Qwen3-TTS-0.6B-Base-INT8-MNN --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --normalize 0.95 推理时间比较长,并且只有电流声 当我的text用”你好,千问“,能够正常输出,但RTF值比较大。

问题已修复,是没有加reference voice参考音频的原因。官方Demo需要添加一段声音作为参考音频才能正常生成。 现在您尝试 build-linux/qwen3_tts_demo model/Qwen3-TTS-0.6B-Base-MNN-int8 --text "一九九三年二月二十三日上午,四川省安岳县安源乡武村彭家姑嫂五人进城购置衣服" 64 ./tts_output/ chinese --ref_audio apps/iOS/MNNLLMChat/MNNLLMiOS/LocalBatchTest/Audios/BAC009S0764W0121.wav --normalize 0.95
生成音频在: ./tts_output/qwen3_tts_text.wav
如果要对比 fp16,把模型路径替换成: model/Qwen3-TTS-0.6B-Base-MNN-fp16

根据以上命令,这是以下输出 CPU Group: [ 1 2 3 4 ], 799999 - 1799998 CPU Group: [ 7 8 ], 799830 - 2199850 CPU Group: [ 5 6 ], 799830 - 2299829 CPU Group: [ 9 10 ], 799830 - 2499787 CPU Group: [ 0 11 ], 799830 - 2600083 The device supports: i8sdot:1, fp16:1, i8mm: 1, sve2: 1, sme2: 0 waveform shape=[1,122880] size=122880 waveform first16: 0.00023078975 0.0002876065 0.00030268927 0.00032124258 0.00024789077 2.1432717e-05 -0.00028724791 -7.7549652e-05 2.0121633e-05 -3.7976828e-05 -0.00016274943 -0.00020869241 -0.00020560113 -0.00023263895 -0.00026221521 -0.00029193162 normalize target_peak=0.95 original_peak=1 scale=0.95 waveform_normalized shape=[1,122880] size=122880 waveform_normalized first16: 0.00021925026 0.00027322618 0.00028755481 0.00030518044 0.00023549623 2.0361082e-05 -0.00027288552 -7.367217e-05 1.9115552e-05 -3.6077985e-05 -0.00015461196 -0.00019825778 -0.00019532107 -0.00022100699 -0.00024910446 -0.00027733503 saved wav: /home/cix/workspace/TTS_llama.cpp/tts_output/qwen3_tts_text.wav Qwen3-TTS text C++ chain finished. frames=64

生成的语音不完整只有一半,把64提高到128就完整了,目前生成的时间貌似比较慢,另外可以添加一个计算rtf的功能吗?

对的,这个64 128的数字是用来提前截断限制生成长度的,就和max_new_token一样,可以设置大一些,它生成完整会自己终止。
生成时间的话可以在ARM架构手机上跑一下,ARM的CPU会比Intel CPU在计算上快几倍。

@huangzhengxiang

Copy link
Copy Markdown
Contributor Author

rtf 就先不加啦,暂时可以把生成的文件保存下来在MNN外面计算一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants