diff --git a/src/huggingface_hub/_snapshot_download.py b/src/huggingface_hub/_snapshot_download.py index b8978a17f37..c7e72580bb3 100644 --- a/src/huggingface_hub/_snapshot_download.py +++ b/src/huggingface_hub/_snapshot_download.py @@ -167,7 +167,7 @@ def snapshot_download( # if we have internet connection we retrieve the correct folder name from the huggingface api _api = HfApi() repo_info = _api.repo_info( - repo_id=repo_id, repo_type=repo_type, revision=revision, token=token + repo_id=repo_id, repo_type=repo_type, revision=revision, use_auth_token=token ) filtered_repo_files = list( filter_repo_objects( diff --git a/src/huggingface_hub/keras_mixin.py b/src/huggingface_hub/keras_mixin.py index b834497895b..472e4ac843f 100644 --- a/src/huggingface_hub/keras_mixin.py +++ b/src/huggingface_hub/keras_mixin.py @@ -439,7 +439,7 @@ def push_to_hub_keras( # Delete previous log files from Hub operations += [ CommitOperationDelete(path_in_repo=file) - for file in api.list_repo_files(repo_id=repo_id, token=token) + for file in api.list_repo_files(repo_id=repo_id, use_auth_token=token) if file.startswith("logs/") ]