Repository navigation
Chunk CJK text for MioTTS at 120 codepoints by default - #1046
Merged
Merged
Conversation
Each chunk is generated within max_tokens, 700 tokens or 28 s, and Japanese is spoken at about 5-6 characters a second, so a 180-codepoint chunk of it ran past the limit and its end was cut without an error. Use 120 codepoints when hanzi, kana and Hangul outnumber other letters and digits; other text keeps 180, and an explicit request or session chunk size still wins.
Owner
|
@hiroki-abe-58 Thanks! PR merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MioTTS generates each chunk within
max_tokens, 700 tokens or 28 s, and its default chunk is 180 codepoints. Japanese is spoken at about 5–6 characters a second, so a 180-codepoint chunk of it needs more than 28 s, and the end of the chunk is cut without an error. On a 304-character text the output is exactly 2 × 28 s = 56.0 s on 9 of 12 seeds (53.6–55.6 s on the rest), and a clause at the end of the first chunk (「昼過ぎになると観光客が増え、」) is missing.The official MioTTS-Inference server doesn't chunk. It accepts up to 300 characters per request with the same
max_tokens700.This PR uses 120 codepoints by default when hanzi, kana and Hangul outnumber other letters and digits, the same rule as
ming3_tts,fireredtts3andmoss_tts_nano.text_chunk_sizeor sessionmiotts.text_chunk_sizestill wins.Measurements
RTX 5090, Windows 11, CUDA build (
120a-real),miotts-1.7b-q8_0.gguf+miocodec-25hz-44khz-v2-q8_0.gguf, voice clone with a 2.6 s Japanese reference. CER is from Whisper large-v3-turbo with sequential long-form decoding, over seeds 1–12, given as mean / median / max.100 has the lowest medians, but on 1 of 12 seeds one chunk of the 304-character text fell into repetition and long silences. 120 had no run above 0.13 in 24, so it is the default here; 130 was similar to 120 over 6 seeds. The 141-character text becomes two chunks and stays at 0.023 / 0.030.
MioTTS output on CUDA is not bit-reproducible run to run: the same request twice, with the same seed and chunks, gives different WAVs. So instead of byte checks, the
--logtrace confirms the branch's defaults:text_chunk_size 120with the same chunk counts as--text-chunk-size 120on main (5 and 4 chunks).The branch's own CER (0.026 / 0.026 and 0.066 / 0.059 for seeds 1–2) is in line with the table.
🤖 Generated with Claude Code