Make logs tf compliant (#9565)

This commit is contained in:
Julien Plu
2021-01-14 10:56:53 +01:00
committed by GitHub
parent 14d677ca4a
commit a26536f0c8

View File

@@ -285,7 +285,7 @@ def booleans_processing(config, **kwargs):
or kwargs["output_hidden_states"] 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."
"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
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
if "use_cache" in kwargs: