Skip to content

Fix: honor repetition_penalty in Whisper decoding options - #1

Merged
monai merged 1 commit into
mainfrom
fix/repetition-penalty-dropped
Aug 28, 2026
Merged

monai merged 1 commit into
mainfrom
fix/repetition-penalty-dropped

Conversation

@monai

@monai monai commented Aug 28, 2026

Copy link
Copy Markdown
Owner

DecodingOptions.repetition_penalty does nothing. No logit filter reads it. Cause: Blaizzy#873 allows kwargs by dataclass field, not by real use. Same bug as Blaizzy#530.

repetition_penalty works in transformers (RepetitionPenaltyLogitsProcessor) and in faster-whisper (added in v0.8.0, SYSTRAN/faster-whisper#478). Note: openai/whisper does not support this option. This fix matches those other backends, not openai/whisper.

Adds a RepetitionPenalty logit filter (divide/multiply, like HF) and uses it when options.repetition_penalty is set.

Found during an ASR accuracy check. Helps lower WER, together with #2 and #3.

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.
@monai
monai marked this pull request as ready for review August 28, 2026 14:12
@monai
monai merged commit 0c1a51b into main Aug 28, 2026
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