Skip to content

fix(asr/nemotron-multilingual): skip unchanged partial callbacks - #1005

Merged
Alex-Wengg merged 1 commit into
FluidInference:mainfrom
JulianPscheid:fix/nemotron-skip-unchanged-partials
Oct 9, 2026
Merged

Alex-Wengg merged 1 commit into
FluidInference:mainfrom
JulianPscheid:fix/nemotron-skip-unchanged-partials

Conversation

@JulianPscheid

Copy link
Copy Markdown
Contributor

Follow-up to #994.

With blank rescue enabled, processChunkTracked publishes after every chunk, and since #994 it does so even when the settled text has not changed: during silence, or when the chunk's new tokens are still held behind a rescue frontier. A chunk that decoded tokens can also publish the same string twice, once from the pipeline and once at the end of the chunk. Before #994 the callback fired only when tokens were decoded. A consumer that restarts a timer on every partial never sees it expire while these repeats arrive each chunk. PunctuationCommitLayer.processPartialText is one: it invalidates its debounce on each call, so an unpunctuated tail stays uncommitted until punctuation arrives or the stream ends.

publishPartialTranscript now remembers the last text it delivered and skips the callback when the new text is identical. That covers the end-of-chunk publish, both pipeline publish sites and the finish() flush. A flush that releases withheld text differs from the last delivery, so it still fires. The history is cleared in reset(), resetStates() and finish(), so a new stream starts fresh. With rescue disabled the callback behaves as before. The callback doc comment now says text is delivered only when it changes.

Tests: seven new cases in NemotronMultilingualPublicationTests cover unchanged text delivering once, changed text delivering, the same text delivering again after reset() and after resetStates(), the final flush delivering changed text once and skipping text already delivered live, and unchanged rescue-disabled behavior. They failed before the change (9 assertion failures) and pass after it. swift build, the Nemotron suites (124 tests) and swift format lint on the changed files pass.

@Alex-Wengg
Alex-Wengg merged commit e90e84f into FluidInference:main Oct 9, 2026
21 checks passed
@JulianPscheid
JulianPscheid deleted the fix/nemotron-skip-unchanged-partials branch October 9, 2026 03:05
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