From 556d2c23c62ee9754887d076b35f6fb6a95cace9 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 11 Mar 2025 13:29:15 +0000 Subject: [PATCH] Remove remote code warning (#36285) * Remove redundant pipeline warning * Remove redundant pipeline warning --- src/transformers/modeling_utils.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index 4a1a683c6b..c4cf20c060 100755 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -3574,7 +3574,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix proxies = kwargs.pop("proxies", None) output_loading_info = kwargs.pop("output_loading_info", False) use_auth_token = kwargs.pop("use_auth_token", None) - trust_remote_code = kwargs.pop("trust_remote_code", None) + _ = kwargs.pop("trust_remote_code", None) _ = kwargs.pop("mirror", None) from_pipeline = kwargs.pop("_from_pipeline", None) from_auto_class = kwargs.pop("_from_auto", False) @@ -3665,11 +3665,6 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix if use_safetensors is None and not is_safetensors_available(): use_safetensors = False - if trust_remote_code is True: - logger.warning( - "The argument `trust_remote_code` is to be used with Auto classes. It has no effect here and is" - " ignored." - ) if gguf_file is not None and not is_accelerate_available(): raise ValueError("accelerate is required when loading a GGUF file `pip install accelerate`.")