Skip to content

Flush final pending token in offline generate()#6

Open
artuskg wants to merge 1 commit into
awni:mainfrom
artuskg:codex/awni-fix4-generate-flush
Open

Flush final pending token in offline generate()#6
artuskg wants to merge 1 commit into
awni:mainfrom
artuskg:codex/awni-fix4-generate-flush

Conversation

@artuskg
Copy link
Copy Markdown

@artuskg artuskg commented Feb 9, 2026

Bug fix: flush final pending token in offline generate()

Problem

generate() uses a pending-token decode pattern (y is emitted while next_y is being computed). If the loop ends naturally without EOS, the final pending token is dropped.

Resolution

After the decode loop, flush the final pending token when it is not EOS.

Why this helps

Prevents deterministic one-token truncation at end-of-audio in non-EOS termination path.

Regression test

  • tests/test_bugfix_generate_flush_optional.py::test_generate_flushes_last_pending_non_eos_token

How to run

VOXMLX_ENABLE_MLX_RUNTIME_TESTS=1 python3 -m unittest -v tests.test_bugfix_generate_flush_optional

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.

1 participant