Unverified Commit a26536f0 authored by Julien Plu's avatar Julien Plu Committed by GitHub
Browse files

Make logs tf compliant (#9565)

parent 14d677ca
...@@ -285,7 +285,7 @@ def booleans_processing(config, **kwargs): ...@@ -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): ...@@ -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:
......
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