From 03935d300d60110bb86edb49d2315089cfb19789 Mon Sep 17 00:00:00 2001 From: Lucain Date: Fri, 24 May 2024 11:00:59 +0200 Subject: [PATCH] Do not trigger autoconversion if local_files_only (#31004) --- src/transformers/modeling_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/modeling_utils.py b/src/transformers/modeling_utils.py index 354962bab055df..e58185dc7c5acc 100755 --- a/src/transformers/modeling_utils.py +++ b/src/transformers/modeling_utils.py @@ -3393,7 +3393,7 @@ def from_pretrained( if resolved_archive_file is not None: is_sharded = True - if resolved_archive_file is not None: + if not local_files_only and resolved_archive_file is not None: if filename in [WEIGHTS_NAME, WEIGHTS_INDEX_NAME]: # If the PyTorch file was found, check if there is a safetensors file on the repository # If there is no safetensors file on the repositories, start an auto conversion