Make logs tf compliant (#9565)
This commit is contained in:
@@ -285,7 +285,7 @@ def booleans_processing(config, **kwargs):
|
|||||||
or kwargs["output_hidden_states"] is not None
|
or kwargs["output_hidden_states"] is not None
|
||||||
or ("use_cache" in kwargs and kwargs["use_cache"] is not None)
|
or ("use_cache" in kwargs and kwargs["use_cache"] is not None)
|
||||||
):
|
):
|
||||||
logger.warning(
|
tf.print(
|
||||||
"The parameters `output_attentions`, `output_hidden_states` and `use_cache` cannot be updated when calling a model."
|
"The parameters `output_attentions`, `output_hidden_states` and `use_cache` cannot be updated when calling a model."
|
||||||
"They have to be set to True/False in the config object (i.e.: `config=XConfig.from_pretrained('name', output_attentions=True)`)."
|
"They have to be set to True/False in the config object (i.e.: `config=XConfig.from_pretrained('name', output_attentions=True)`)."
|
||||||
)
|
)
|
||||||
@@ -294,7 +294,7 @@ def booleans_processing(config, **kwargs):
|
|||||||
final_booleans["output_hidden_states"] = config.output_hidden_states
|
final_booleans["output_hidden_states"] = config.output_hidden_states
|
||||||
|
|
||||||
if kwargs["return_dict"] is not None:
|
if kwargs["return_dict"] is not None:
|
||||||
logger.warning("The parameter `return_dict` cannot be set in graph mode and will always be set to `True`.")
|
tf.print("The parameter `return_dict` cannot be set in graph mode and will always be set to `True`.")
|
||||||
final_booleans["return_dict"] = True
|
final_booleans["return_dict"] = True
|
||||||
|
|
||||||
if "use_cache" in kwargs:
|
if "use_cache" in kwargs:
|
||||||
|
|||||||
Reference in New Issue
Block a user