Unverified Commit 09f9d072 authored by Matt's avatar Matt Committed by GitHub
Browse files

Misfiring tf warnings (#15442)

* Fix spurious warning in TF TokenClassification models

* Fixing one last spurious warning

* Removing outdated warning altogether
parent 6915174e
......@@ -325,16 +325,6 @@ def booleans_processing(config, **kwargs):
kwargs["use_cache"] if kwargs["use_cache"] is not None else getattr(config, "use_cache", None)
)
else:
if (
kwargs["output_attentions"] not in (None, config.output_attentions)
or kwargs["output_hidden_states"] not in (None, config.output_hidden_states)
or ("use_cache" in kwargs and kwargs["use_cache"] not in (None, config.use_cache))
):
tf_logger.warning(
"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)`)."
)
final_booleans["output_attentions"] = config.output_attentions
final_booleans["output_hidden_states"] = config.output_hidden_states
......
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