Repository navigation
Split long Ming 3.0 TTS voice design and freeform text like the official runtime - #1034
Merged
Merged
Conversation
…ial runtime Voice design and freeform requests were never chunked, so long text ran past the 512-position context and most of it was dropped without an error. Chunk them like the other templates and, as the official runtime does since 028c1eac, give every chunk after the first the first generated chunk as its reference, so the designed voice stays the same. The reference ends where its speech ends, because a decode history that starts in the trailing silence made some chunks stop at once. Design chunks default to at most 120 codepoints so that the reference and the chunk both fit in the context.
Owner
|
@hiroki-abe-58 Thanks! PR merged. |
Contributor
Author
|
Edge cases, voice design bf16, seeds 1-2, compared with main 41bb3f0: short Chinese, Chinese without final punctuation, a 134-character Chinese run without punctuation (still one chunk, as on main) and an 88-character Chinese+English text are byte-identical to main. A 271-character Chinese text with two English sentences goes from CER 0.538 / 0.265 (one 21 s chunk) to 0 / 0 in 3 chunks. |
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.
Voice design and freeform requests are never chunked, so a long text runs past the 512-position context and most of it is dropped without an error. A 404-character Japanese text comes out as 6.4 s of audio.
Upstream fixed this in 028c1eac ("improve 0.5B long-text splitting and voice consistency"). Voice design and freeform requests are now split too, and every fragment after the first takes the first generated fragment as its reference (CAM++ speaker embedding, prompt latent and its text), so the designed voice doesn't change between fragments.
This PR ports that:
prepare_referenceis split into an uncachedencode_reference, so the generated audio never replaces the user's cached reference.raw_text=trueand an explicittext_chunk_sizebehave as before.Measurements
RTX 5090, Windows 11, CUDA build (
120a-real),ming-3.0-tts-0.5b-bf16.gguf, seeds 1–4. CER is from Whisper large-v3-turbo with sequential long-form decoding. "Voice" is the mean cosine similarity of SpeechBrain ECAPA embeddings of 4 s windows to the first window; one designed voice scores about 0.8.Voice design (
--task vdes,instruct=落ち着いた大人の女性。明るく聞き取りやすい声で、ゆっくり話している。):text_chunk_size(no reference reuse)Freeform (
template_name=freeform,instruct=Speak in a calm, warm adult female voice at a slow pace.):text_chunk_sizeFor comparison, the official runtime at 028c1eac (
infer.py --task FREEFORM --no_text_normalization) produced 37.5–41.3 s on the Chinese text over seeds 1–6, and this PR produces 35.6–41.4 s over seeds 1–12.Byte checks against main:
ttsis unchanged (16 WAVs).The branch is rebased on 41bb3f0, after #1023. A rerun of the design, freeform,
ttsand clone checks on the rebased build is byte-identical to the runs above (22 WAVs).🤖 Generated with Claude Code