Repository navigation
Chunk CJK text for MOSS-TTS-Nano at 50 codepoints by default - #1025
Merged
Merged
Conversation
A 256-codepoint chunk of hanzi, kana or Hangul holds several of upstream's 50-75-token voice-clone chunks, so it runs into the 300-frame limit or stops early and the rest of the chunk is dropped without an error. Use 50 codepoints when CJK characters outnumber other letters and digits; other text keeps 256.
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.
MOSS-TTS-Nano chunks long text at 256 codepoints. That fits English, but a 256-codepoint chunk of Chinese, Japanese or Korean needs more speech than the 300-frame (24 s)
max_tokenslimit allows, or the model stops early. The rest of the chunk is dropped without an error.Upstream voice cloning (
_split_text_into_best_sentences) packs sentences into chunks of at most 50 text tokens by default, or 75 from its CLI. Its tokenizer spends 0.7–1.2 tokens on a hanzi, kana or Hangul syllable but about 0.25 on a Latin character, so its chunks are:This PR uses 50 codepoints by default when hanzi, kana and Hangul outnumber other letters and digits, the same rule as
ming3_tts; other text keeps 256. An explicittext_chunk_sizestill wins. The spec, CLI help and docs are updated.Measurements
RTX 5090, Windows 11, CUDA build (
120a-real),moss-tts-nano-100m-bf16.gguf. CER is from Whisper large-v3-turbo with sequential long-form decoding, averaged over seeds 1–6.Voice clone (
--task clon), with upstream's preset voiceszh_1(Chinese),jp_2(Japanese and Korean, since there is no Korean preset) anden_2(English):Text-only (
--task tts):The
--logtrace shows the cause on main, with voice clone:max_new_frames(300) on 4 of the 6 seeds and ends early, at 199 or 210 frames, on the other 2.Byte checks:
--text-chunk-size 50(42 WAVs, clone and text-only).--mode streaming) also takes the new default.🤖 Generated with Claude Code