Skip to content

Chunk Chinese and Korean text for MagpieTTS at 60 codepoints by default - #1043

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

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

Conversation

@hiroki-abe-58

@hiroki-abe-58 hiroki-abe-58 commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Merged with the 60-codepoint default described below. A later edge-case test found that 60 also splits short mixed Chinese/English text and makes the English unintelligible; the switch to 100 is in #1044.

MagpieTTS generates each text segment within max_tokens, 500 frames or about 23 s. The default 300-codepoint chunk fits that for English, but 300 codepoints of Chinese or Korean need about a minute of speech. The end of every long chunk is cut without an error: a 219-character Chinese text comes out as 22–23 s of audio.

NeMo doesn't send chunks that long. chunk_text_for_inference splits text into sentences, one per chunk, once it passes a per-language threshold of about 20 s of audio (100 characters for zh).

This PR makes the default 60 codepoints for zh and ko; other languages keep 300.

  • text_chunk_size becomes optional in the generation options and is resolved in the tokenizer, where the language is known. An explicit value, including one from session preparation, is kept as before.
  • The spec and docs are updated.

Measurements

RTX 5090, Windows 11, CUDA build (120a-real), magpie-tts-multilingual-357m-q8_0.gguf, default voice (Aria). CER is from Whisper large-v3-turbo with sequential long-form decoding.

text main this PR (60) audio, main → PR
Chinese, 219 chars 0.361 / 0.386 0.020 / 0.020 (mean over seeds 1–6 0.019) 23.2 / 21.8 s → 42.9 / 42.5 s
Chinese, 415 chars 0.398 / 0.369 0.016 / 0.027 (mean over seeds 1–6 0.023) 45.0 / 46.4 s → 82.3 / 81.9 s
Korean, 331 chars 0.269 / 0.274 0.026 / 0.030 28.8 / 28.6 s → 39.1 / 39.8 s
English, 782 chars 0.017 / 0.017 identical WAVs

Other voices on the 415-character Chinese and the Korean text:

  • Jason: 0.029 / 0.029 and 0.030 / 0.034.
  • Leo: 0.029 / 0.027 and 0.021 / 0.026.

Other chunk sizes over seeds 1–6 on the 415-character Chinese text:

  • 100: mean 0.027, max 0.029. On the 219-character text, max 0.040.
  • 80: mean 0.062, max 0.149. On seed 1 a 57-character sentence was skipped inside its chunk; seed 5 scored 0.095.

Byte checks:

  • The default output of this PR is identical to main with --text-chunk-size 60 for zh and ko, across three voices.
  • English is identical to main's default.
  • --text-chunk-size 300 on Chinese is identical to main's default.
  • 18 WAVs in total.

🤖 Generated with Claude Code

Each text segment is generated within max_tokens, 500 frames or about 23 s, but a 300-codepoint chunk of Chinese or Korean needs about a minute of speech, so the end of every long chunk was cut without an error. NeMo speaks long text of these languages one sentence at a time; use 60 codepoints for zh and ko. Other languages keep 300, and an explicit text_chunk_size is kept as before, including from session preparation.
@0xShug0
0xShug0 merged commit 37c931a into 0xShug0:main Oct 21, 2026
7 checks passed
@0xShug0

0xShug0 commented Oct 21, 2026

Copy link
Copy Markdown
Owner

@hiroki-abe-58 Merged! Thanks.

@hiroki-abe-58 hiroki-abe-58 changed the title Chunk Chinese and Korean text for MagpieTTS at 60 codepoints by default Chunk Chinese and Korean text for MagpieTTS at 100 codepoints by default Oct 21, 2026
@hiroki-abe-58

Copy link
Copy Markdown
Contributor Author

Updated to 100 codepoints (60c8b37) after edge-case tests: 60 also split short mixed text (a Chinese sentence followed by an English one) and the English part came out unintelligible (CER 0.743 vs 0 on main). 100 keeps that text whole and still fixes the long Chinese/Korean cases; numbers are in the description.

@hiroki-abe-58 hiroki-abe-58 changed the title Chunk Chinese and Korean text for MagpieTTS at 100 codepoints by default Chunk Chinese and Korean text for MagpieTTS at 60 codepoints by default Oct 21, 2026
@hiroki-abe-58

Copy link
Copy Markdown
Contributor Author

This merged before my update, so main has 60; the 100 change is in #1044.

@0xShug0

0xShug0 commented Oct 21, 2026

Copy link
Copy Markdown
Owner

1044 merged!

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