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 May 24, 2024
1 parent 21e259d commit 03935d3
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 @@ -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
Expand Down

0 comments on commit 03935d3

Please sign in to comment.