Skip to content

Improve Higgs TTS token-limit error guidance - #522

Merged
0xShug0 merged 2 commits into
0xShug0:mainfrom
mwzkhalil:ci/higgs-tts-chunk-seed-consistency
Sep 14, 2026
Merged

0xShug0 merged 2 commits into
0xShug0:mainfrom
mwzkhalil:ci/higgs-tts-chunk-seed-consistency

Conversation

@mwzkhalil

@mwzkhalil mwzkhalil commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Change

Improve the error reported when a Higgs TTS text chunk reaches max_tokens before EOC:

  • Include the configured token limit.
  • Clarify that the limit applies to the current text chunk.
  • Point users to --max-tokens / max_tokens and --text-chunk-size / text_chunk_size.

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.

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
@0xShug0

0xShug0 commented Sep 12, 2026

Copy link
Copy Markdown
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.

@0xShug0 0xShug0 changed the title fix(higgs_audio_tts): share one sampling seed across chunks of a request Improve Higgs TTS token-limit error guidance Sep 14, 2026
@0xShug0
0xShug0 merged commit 582a63c into 0xShug0:main Sep 14, 2026
@0xShug0

0xShug0 commented Sep 14, 2026

Copy link
Copy Markdown
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.

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