Unverified Commit 0f079b93 authored by Álvaro Somoza's avatar Álvaro Somoza Committed by GitHub
Browse files

[Fix] Using sharded checkpoints with gated repositories (#9737)

fix
parent b0ffe922
...@@ -457,7 +457,7 @@ def _get_checkpoint_shard_files( ...@@ -457,7 +457,7 @@ def _get_checkpoint_shard_files(
ignore_patterns = ["*.json", "*.md"] ignore_patterns = ["*.json", "*.md"]
if not local_files_only: if not local_files_only:
# `model_info` call must guarded with the above condition. # `model_info` call must guarded with the above condition.
model_files_info = model_info(pretrained_model_name_or_path, revision=revision) model_files_info = model_info(pretrained_model_name_or_path, revision=revision, token=token)
for shard_file in original_shard_filenames: for shard_file in original_shard_filenames:
shard_file_present = any(shard_file in k.rfilename for k in model_files_info.siblings) shard_file_present = any(shard_file in k.rfilename for k in model_files_info.siblings)
if not shard_file_present: if not shard_file_present:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment