Fix: honor repetition_penalty in Whisper decoding options - #1
Merged
Merged
Conversation
DecodingOptions declared a repetition_penalty field but no logit filter used it, so the setting was silently ignored during decoding. Add a RepetitionPenalty logit filter (HF-style: divide the logit by the penalty when positive, else multiply) and wire it into DecodingTask's filter list whenever options.repetition_penalty is set, matching the behavior of Hugging Face transformers' Whisper generation pipeline.
This was referenced Aug 28, 2026
monai
marked this pull request as ready for review
August 28, 2026 14:12
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.
DecodingOptions.repetition_penaltydoes nothing. No logit filter reads it. Cause: Blaizzy#873 allows kwargs by dataclass field, not by real use. Same bug as Blaizzy#530.repetition_penaltyworks intransformers(RepetitionPenaltyLogitsProcessor) and infaster-whisper(added in v0.8.0, SYSTRAN/faster-whisper#478). Note:openai/whisperdoes not support this option. This fix matches those other backends, notopenai/whisper.Adds a
RepetitionPenaltylogit filter (divide/multiply, like HF) and uses it whenoptions.repetition_penaltyis set.Found during an ASR accuracy check. Helps lower WER, together with #2 and #3.