Skip to content

Commit

Permalink
fix: [whisper] don't overwrite GenerationConfig's return_timestamps
Browse files Browse the repository at this point in the history
… when `return_timestamps` is not passed to `generate` function (#31296)

[whisper] don't overwrite return_timestamps when not passed to generate
  • Loading branch information
hrl authored Aug 21, 2024
1 parent 8713466 commit c6d484e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/transformers/models/whisper/generation_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,9 @@ def _set_return_outputs(return_dict_in_generate, return_token_timestamps, logpro
return return_dict_in_generate

def _set_return_timestamps(self, return_timestamps, is_shortform, generation_config):
if return_timestamps is None and hasattr(generation_config, "return_timestamps"):
return_timestamps = generation_config.return_timestamps

if not is_shortform:
if return_timestamps is False:
raise ValueError(
Expand Down

0 comments on commit c6d484e

Please sign in to comment.