Improve Higgs TTS token-limit error guidance - #522
Merged
0xShug0 merged 2 commits intoSep 14, 2026
Merged
Conversation
Long text is split into chunks (session.cpp chunk_text_request) and generator_->generate() runs once per chunk. When a caller does not pass --seed, each of those calls independently draws a fresh random seed (generator.cpp: request.options.seed.value_or(random_u64_seed())), so an unseeded multi-chunk request sampled every chunk against the same reference-voice conditioning but with unrelated entropy. That is a plausible contributor to the voice/timbre drift between chunks reported in 0xShug0#471 (Arabic voice cloning switching speakers partway through, worse with smaller --text-chunk-size since that means more chunk boundaries). HiggsTTSSession::run() now resolves one seed up front when the request did not supply one, and copies it onto every chunk before generation, the same as when a caller already passes --seed explicitly. This only changes behavior for the previously-undefined unseeded case; an explicit --seed still works exactly as before. Also makes the "reached max_tokens before EOC" failure actionable: it now names the configured max_tokens value and points at --max-tokens / --text-chunk-size (or their server request-option equivalents) instead of leaving the caller to guess, which was the other half of 0xShug0#471. Ref 0xShug0#471
Owner
|
@mwzkhalil Unless I’m missing something, setting the seed won’t fix this issue. Please provide wavs generated by higgs tts on CPU with your PR applied using the test case provided in the issue. |
Owner
|
@mwzkhalil I’ve kept the error-message improvement, thanks! A follow-up PR for the seed change would be welcome, with logs showing that it helps resolve the voice drift. |
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.
Change
Improve the error reported when a Higgs TTS text chunk reaches max_tokens before EOC:
The failure condition and generation behavior are unchanged. The proposed seed change has been removed; this PR does not claim to fix voice drift in #471.
Validation
Reviewed the final diff: only the error message in generator.cpp changes. git diff --check passes. No new inference tests were run for this message-only change.
The original author commit is retained; the scope reduction is a maintainer follow-up commit.