"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "479322bfaa280c39ab3c33472a51ea2dccfba1f5"
Unverified Commit e00bc7cd authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Silence warning in gradient checkpointing when it's False (#13734)

parent 3ffd18a6
...@@ -332,7 +332,7 @@ class PretrainedConfig(PushToHubMixin): ...@@ -332,7 +332,7 @@ class PretrainedConfig(PushToHubMixin):
self.transformers_version = kwargs.pop("transformers_version", None) self.transformers_version = kwargs.pop("transformers_version", None)
# Deal with gradient checkpointing # Deal with gradient checkpointing
if "gradient_checkpointing" in kwargs: if kwargs.get("gradient_checkpointing", True):
warnings.warn( warnings.warn(
"Passing `gradient_checkpointing` to a config initialization is deprecated and will be removed in v5 " "Passing `gradient_checkpointing` to a config initialization is deprecated and will be removed in v5 "
"Transformers. Using `model.gradient_checkpointing_enable()` instead, or if you are using the " "Transformers. Using `model.gradient_checkpointing_enable()` instead, or if you are using the "
......
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