mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
fix: [whisper] don't overwrite GenerationConfig's return_timestamps
when return_timestamps
is not passed to generate
function (#31296)
[whisper] don't overwrite return_timestamps when not passed to generate
This commit is contained in:
parent
87134662f7
commit
c6d484e38c
@ -1170,6 +1170,9 @@ class WhisperGenerationMixin:
|
||||
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(
|
||||
|
Loading…
Reference in New Issue
Block a user