Fix WhisperForConditionalGeneration to respect generation_config? #30623
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.
I had to change a line in
WhisperGenerationMixin
for it to generate with timestamps during evaluation.Many parameters of
WhisperGenerationMixin.generate
areNone
by deafult. So that whenWhisperForConditionalGeneration.generate
is called with default parameters andreturn_timestamps
is set to True in generation_config,WhisperGenerationMixin._set_return_timestamps
is called and replaces the value in the config with None.The same thing happens with
return_token_timestamps
in the method_set_return_outputs
, so I'm unsure if this is intended.Should I maybe open an issue first?
What does this PR do?
Change
WhisperGenerationMixin._set_return_timestamps
to only replace the valuereturn_timestamps
ingeneration_config
if new value is notNone
.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
I can see @patrickvonplaten was the last person who worked on these lines.