onnx吞字吞句严重
RT,无论是CPU还是CUDA,都会随机出现,而且频率很高 比如就自带的 “深夜温柔晚安”那个案例,我测试没有一次生成完整过的,都是最后一句或几句被吞了
而且语速忽快忽慢
以上问题,无论是从社区issue,还是discord的反馈,都是普遍存在的
速度是快了,但根本无法用于实时推理,希望后期能优化
Thanks for the feedback. For the ONNX version, we can take the built-in “深夜温柔晚安” case as an example.
For this case, the missing-ending issue is mainly caused by the current Max New Frames limit. This voice/style is relatively slow, while the default Max New Frames is 375, which corresponds to about 30 seconds of audio. This is a conservative default for realtime usage, but for slower speech or longer chunks, the generation can hit this frame limit before the model naturally emits the end token, so the last sentence may sound cut off.
Please try increasing Max New Frames, for example:
Max New Frames = 600
This corresponds to about 48 seconds of audio and allows each chunk to generate longer audio. In our local test, increasing this value avoids the ending being cut off for this case.
You can also reduce Voice Clone Max Text Tokens, for example:
Voice Clone Max Text Tokens = 60
This reduces the amount of text handled by each chunk, making it less likely for a single chunk to hit the frame limit.
You can also try changing the random Seed, since sampling can produce better or worse outputs depending on the seed.
If you suspect the sampling parameters themselves are the issue, note that the ONNX app has different sampling modes. The default fixed Sampling Mode uses sampling parameters baked into the exported ONNX graph for better runtime performance. In this mode, changing the sampling parameter inputs in the app will not affect the fixed sampling graph. To change the fixed-mode sampling behavior, you need to modify the constants in onnx/export_moss_tts_browser_onnx.py and re-export the ONNX model.
Specifically, you can adjust these constants near the top of the export script:
FIXED_SAMPLED_TEXT_TEMPERATURE = 1.0
FIXED_SAMPLED_TEXT_TOP_P = 1.0
FIXED_SAMPLED_TEXT_TOP_K = 50
FIXED_SAMPLED_AUDIO_TEMPERATURE = 0.8
FIXED_SAMPLED_AUDIO_TOP_P = 0.95
FIXED_SAMPLED_AUDIO_TOP_K = 25
FIXED_SAMPLED_AUDIO_REPETITION_PENALTY = 1.2
For example, you can change a different FIXED_SAMPLED_AUDIO_TEMPERATURE, FIXED_SAMPLED_AUDIO_TOP_P, or FIXED_SAMPLED_AUDIO_REPETITION_PENALTY, then run the export again.