Keep text after the last timestamp pair in batched decoding - #13
Merged
Merged
Conversation
With batch_size > 1, text decoded after the last pair of timestamp tokens in a window was dropped: the one-window path re-decodes that audio from the last timestamp, but a batch always moves on by a full window, so the text was never recovered. It is now kept as a final segment that runs to the end of its window. Each segment from a batch also recorded the batch's first seek instead of its own window's; new_segment now takes seek explicitly. Adds a stub-model fixture so transcribe() can be exercised without weights. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
1 of 3 tasks
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.
What does this PR do?
Closes #3.
batch_size > 1, text decoded after the last pair of timestamp tokens in a window was dropped. The one-window path re-decodes that audio from the last timestamp, but a batch always moves on by a full window, so the text was never recovered. It's now kept as a final segment from its timestamp to the end of the window. The last window ends at the end of the audio.seek.new_segmentnow takesseekexplicitly: the window's own offset in the batched path, and unchanged in the sequential path.tests/conftest.pywith a stub model, sotranscribe()can be tested without weights.How was this tested?
pytest): 19 passedvayu audio.mp3)New tests in
tests/test_transcribe_batched.py. Two fail onmain: "world" is dropped, andseekvalues come out as[0, 0, 0]. Three pin behaviour that shouldn't change: a single-timestamp ending, a trailing timestamp with no text, and text with no timestamp pairs.The
claude-reviewcheck will fail as it did on #12: theCLAUDE_CODE_OAUTH_TOKENsecret doesn't authenticate (details in this comment).🤖 Generated with Claude Code
https://claude.ai/code/session_01TMXYMqgLAykqRApmbRfpTA
Generated by Claude Code