Skip to content

Commit

Permalink
Do not trigger autoconversion if local_files_only (#31004)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin authored and ArthurZucker committed May 24, 2024
1 parent 75f15f3 commit 12aa316
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,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
Expand Down

0 comments on commit 12aa316

Please sign in to comment.