Surface EOS detection and add text normalization#4
Merged
Conversation
Two related TTS reliability fixes reported by chris-english: EOS detection (issue #1): - All four t3_inference variants (R, traced, cpp, turbo) now track whether the model emitted an end-of-speech token vs hit the token cap, and attach the result as an 'eos_found' attribute on returned tensors - generate() reads the attribute and includes eos_found, n_tokens, and audio_sec in its return list - generate() warns when EOS was not found (output is likely garbage) - tts_to_file() returns a list with path, eos_found, n_tokens, audio_sec so callers iterating over many texts can collect a failure report Text normalization (issue #2): - New normalize_tts_text() lowercases mid-sentence capitalized words, all-caps emphasis words, and internal-caps oddities. Sentence-initial caps and the pronoun "I" are preserved. - generate() applies normalization by default (normalize_text = TRUE). The chatterbox model interprets internal capitals as emphasis cues and often produces silent audio for them, so this addresses a real failure mode reported on inputs like "Yes, Rarely or never Almost never..." 8 new tinytest cases for normalize_tts_text covering the reported failure modes. R CMD check: 0 errors, 0 warnings, 1 harmless NOTE.
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.
Addresses two reliability bugs reported by @chris-english.
Summary
Bugs addressed
tts_to_filetext mitigation strategies - mixed case Upper/lower texts #2: Mixed-case input like "Yes, Rarely or never Almost never..." causes the model to emit only the first word + silence. `normalize_tts_text()` fixes the failing example deterministically.Test plan
tts_to_filetext mitigation strategies - mixed case Upper/lower texts #2 with comments after manual verification, then close again