Skip to content

Commit 03935d3

Browse files
authored
Do not trigger autoconversion if local_files_only (#31004)
1 parent 21e259d commit 03935d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transformers/modeling_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3393,7 +3393,7 @@ def from_pretrained(
33933393
if resolved_archive_file is not None:
33943394
is_sharded = True
33953395

3396-
if resolved_archive_file is not None:
3396+
if not local_files_only and resolved_archive_file is not None:
33973397
if filename in [WEIGHTS_NAME, WEIGHTS_INDEX_NAME]:
33983398
# If the PyTorch file was found, check if there is a safetensors file on the repository
33993399
# If there is no safetensors file on the repositories, start an auto conversion

0 commit comments

Comments
 (0)