Skip to content

Ignore unknown decode options in Whisper generate - #873

Merged
lucasnewman merged 1 commit into
Blaizzy:mainfrom
Lazarus-931:fix/whisper-ignore-unknown-decode-options
Aug 5, 2026
Merged

Ignore unknown decode options in Whisper generate#873
lucasnewman merged 1 commit into
Blaizzy:mainfrom
Lazarus-931:fix/whisper-ignore-unknown-decode-options

Conversation

@Lazarus-931

Copy link
Copy Markdown
Collaborator

Whisper's generate() takes **decode_options and splats them straight into DecodingOptions, so any caller-supplied kwarg the dataclass does not declare raises TypeError. Every other STT model in the tree tolerates extra kwargs, which makes Whisper the odd one out for generic callers that pass a shared set of generation parameters.

The existing code already worked around this by popping max_tokens and generation_stream by hand, an allowlist maintained as a blacklist. Derive the accepted names from fields(DecodingOptions) instead so the filter cannot drift from the dataclass.

Whisper's generate() takes **decode_options and splats them straight
into DecodingOptions, so any caller-supplied kwarg the dataclass does
not declare raises TypeError. Every other STT model in the tree
tolerates extra kwargs, which makes Whisper the odd one out for
generic callers that pass a shared set of generation parameters.

The existing code already worked around this by popping max_tokens and
generation_stream by hand, an allowlist maintained as a blacklist.
Derive the accepted names from fields(DecodingOptions) instead so the
filter cannot drift from the dataclass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@lucasnewman lucasnewman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lucasnewman
lucasnewman merged commit c8403e6 into Blaizzy:main Aug 5, 2026
12 checks passed
@Lazarus-931

Copy link
Copy Markdown
Collaborator Author

closed the other one!

@Lazarus-931

Copy link
Copy Markdown
Collaborator Author

for Blaizzy/nativ#212

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