From 9f8b84fc1e4d607b465c15f76395837695849d7a Mon Sep 17 00:00:00 2001 From: sanchit-gandhi Date: Wed, 22 May 2024 14:25:00 +0100 Subject: [PATCH] [whisper] only trigger forced ids warning once --- src/transformers/models/whisper/generation_whisper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transformers/models/whisper/generation_whisper.py b/src/transformers/models/whisper/generation_whisper.py index 2bdff6e534d..a42d7b7dec3 100644 --- a/src/transformers/models/whisper/generation_whisper.py +++ b/src/transformers/models/whisper/generation_whisper.py @@ -1133,12 +1133,12 @@ def language_to_id(language: str) -> int: forced_decoder_ids = config.forced_decoder_ids if forced_decoder_ids is not None and task is not None: - logger.info( + logger.warning_once( f"You have passed task={task}, but also have set `forced_decoder_ids` to {forced_decoder_ids} which creates a conflict. `forced_decoder_ids` will be ignored in favor of task={task}." ) forced_decoder_ids = None elif forced_decoder_ids is not None and language is not None: - logger.info( + logger.warning_once( f"You have passed language={language}, but also have set `forced_decoder_ids` to {forced_decoder_ids} which creates a conflict. `forced_decoder_ids` will be ignored in favor of language={language}." ) forced_decoder_ids = None