Skip to content

Chunk CJK text for FireRedTTS3 at 80 codepoints by default - #1039

Merged
0xShug0 merged 1 commit into
0xShug0:mainfrom
hiroki-abe-58:fireredtts3-cjk-chunk-size
Oct 21, 2026
Merged

0xShug0 merged 1 commit into
0xShug0:mainfrom
hiroki-abe-58:fireredtts3-cjk-chunk-size

Conversation

@hiroki-abe-58

Copy link
Copy Markdown
Contributor

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.synthesize splits text with split_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_tts and moss_tts_nano.

  • Other text keeps 600; English is unaffected.
  • Semantic and acoustic edits keep 600. They rewrite a given recording, so their text stays whole as before.
  • An explicit text_chunk_size still 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 clon with a 7.9 s Chinese, 2.6 s Japanese or 7.9 s English reference and its transcript):

text main this PR audio, main → PR
Chinese, 219 chars 0.361 / 0.233 0.010 / 0.010 28.8–31.7 s → 45.4–46.6 s
Chinese, 415 chars 0.775 / 0.809 0.000 / 0.000 64.0 / 54.1 s → 89.8–91.8 s
Japanese, 404 chars 0.599 / 0.620 0.024 / 0.021 45.1 / 35.2 s → 68.3–71.0 s
Korean, 331 chars (with --text-chunk-size 600 as main) 0.043 / 0.239 0.034 / 0.030 38.4 / 35.2 s → 45.6 / 44.6 s
Japanese, 141 chars 0.030 / 0.023 0.023 / 0.023
English, 782 chars 0.017 / 0.000 identical WAVs

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=600 gives main's behaviour):

text mode 600 this PR
Chinese, 415 chars voice_design 0.406 / 0.427 (44.3 / 45.6 s) 0.003 / 0.000 (80.6 / 78.9 s)
Chinese, 219 chars voice_design 0.010 / 0.010 0.015 / 0.010
Chinese, 415 chars instruct_tts 0.581 / 0.793 (64.0 s, the step limit) 0.005 / 0.003 (78.4 / 79.8 s)
Chinese, 219 chars instruct_tts 0.020 / 0.035 0.010 / 0.015

Byte checks: the Base default output of this PR is identical to main with --text-chunk-size 80 for the CJK texts, and to main's default for English (10 WAVs).

🤖 Generated with Claude Code

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.
@0xShug0
0xShug0 merged commit 583a04b into 0xShug0:main Oct 21, 2026
7 checks passed
@hiroki-abe-58

Copy link
Copy Markdown
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.

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