Repository navigation
Chunk CJK text for FireRedTTS3 at 80 codepoints by default - #1039
Merged
Merged
Conversation
The official runtime splits Chinese into sentences of about 80 characters, but the 600-codepoint default put up to 600 hanzi, kana or Hangul in one chunk. The model falls into babble or stops early on chunks that long, or runs into its 400-step limit, and the rest of the text is lost without an error. Use 80 codepoints when CJK characters outnumber other letters and digits; other text and semantic or acoustic edits keep 600.
Contributor
Author
|
Edge cases, Base clone q8, compared with main 41bb3f0: short Chinese, Japanese and Korean, Chinese without final punctuation, an 88-character Chinese+English text (more letters than CJK, so 600 still applies) and a 134-character Chinese run without punctuation (one chunk either way) are all byte-identical to main. |
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.
FireRedTTS3 chunks long text at 600 codepoints. A long Chinese or Japanese text therefore goes to the model as one chunk of up to 600 characters. The model speaks the first ~90 characters, then falls into babble, stops early, or runs into the 400-step (64 s) generation limit. The rest is lost without an error.
The official runtime doesn't send chunks that long.
FireRedTTS3.synthesizesplits text withsplit_paragraph(token_max_n=80, token_min_n=60), which measures Chinese in characters. Sentences are merged until a chunk is about 60–80 characters.This PR uses 80 codepoints by default when hanzi, kana and Hangul outnumber other letters and digits, the same rule as
ming3_ttsandmoss_tts_nano.text_chunk_sizestill wins. The spec and docs are updated.Measurements
RTX 5090, Windows 11, CUDA build (
120a-real), q8_0 GGUFs. CER is from Whisper large-v3-turbo with sequential long-form decoding.Base, voice clone (
--task clonwith a 7.9 s Chinese, 2.6 s Japanese or 7.9 s English reference and its transcript):--text-chunk-size 600as main)On the 415-character Chinese text, main's output is correct for its first sentences and then becomes「…可以看到叶片竹林行李咽条发扬行李…左左左,左左左…」. Seeds 3–4 of this PR score 0.010 (219 chars), 0.000 (415 chars) and 0.024 / 0.021 (404 Japanese chars).
Instruct (
--request-option text_chunk_size=600gives main's behaviour):voice_designvoice_designinstruct_ttsinstruct_ttsByte checks: the Base default output of this PR is identical to main with
--text-chunk-size 80for the CJK texts, and to main's default for English (10 WAVs).🤖 Generated with Claude Code