Unverified Commit ada86f97 authored by Sanchit Gandhi's avatar Sanchit Gandhi Committed by GitHub
Browse files

[whisper] only trigger forced ids warning once (#30966)

parent 15185084
...@@ -1133,12 +1133,12 @@ class WhisperGenerationMixin: ...@@ -1133,12 +1133,12 @@ class WhisperGenerationMixin:
forced_decoder_ids = config.forced_decoder_ids forced_decoder_ids = config.forced_decoder_ids
if forced_decoder_ids is not None and task is not None: 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}." 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 forced_decoder_ids = None
elif forced_decoder_ids is not None and language is not 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}." 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 forced_decoder_ids = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment