whisper: align no_speech fallback logic with upstream#1430
Open
AdityaBiranje wants to merge 1 commit into
Open
whisper: align no_speech fallback logic with upstream#1430AdityaBiranje wants to merge 1 commit into
AdityaBiranje wants to merge 1 commit into
Conversation
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.
Summary
Fixes #1427
decode_with_fallbackinmlx_whisper/transcribe.pysuppressed fallbackdecoding whenever
no_speech_probexceededno_speech_threshold, regardlessof
avg_logprob. Upstreamopenai/whisperonly suppresses fallback whenthe segment looks like silence by both measures — high
no_speech_proband low
avg_logprob.Because the MLX condition was broader, a segment that triggered fallback for
an unrelated reason (e.g. high compression ratio / repetitive output) could
still get marked "silence" and have fallback wrongly cancelled, letting
low-quality decodes through undetected.
Change
whisper/mlx_whisper/transcribe.py: added the missinglogprob_threshold/
avg_logprobcheck to the "silence" condition, matching upstream:I extracted this into a small
_needs_fallbackhelper so the logic could beunit tested directly, rather than only through the
decode_with_fallbackclosure.
Testing
no_speech_probwith low compression ratio/logprob threshold stilltriggering fallback correctly.
whisper/tests/— all passing.matches upstream
openai/whisperon the same clip.Notes
No public API changes. This only affects the internal fallback-suppression
condition and should make behavior more consistent with upstream.