From a3911e5503f274ba5b04768cb40962c0ed4c6947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20=C5=A0a=C5=A1ko?= Date: Fri, 15 Dec 2023 14:26:14 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Lucain --- src/huggingface_hub/_commit_api.py | 3 ++- src/huggingface_hub/hf_api.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/huggingface_hub/_commit_api.py b/src/huggingface_hub/_commit_api.py index f2b8f5d854..299f767673 100644 --- a/src/huggingface_hub/_commit_api.py +++ b/src/huggingface_hub/_commit_api.py @@ -570,7 +570,8 @@ def _fetch_lfs_files_to_copy( repo_type=repo_type, ) for src_repo_file in src_repo_files: - assert isinstance(src_repo_file, RepoFile) + if isinstance(src_repo_file, RepoFolder): + raise NotImplementedError("Copying a folder is not implemented.") if not src_repo_file.lfs: raise NotImplementedError("Copying a non-LFS file is not implemented") files_to_copy[(src_repo_file.rfilename, src_revision)] = src_repo_file diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py index 3f8f270a2a..b7d40a6b56 100644 --- a/src/huggingface_hub/hf_api.py +++ b/src/huggingface_hub/hf_api.py @@ -2348,7 +2348,7 @@ def file_exists( return False @validate_hf_hub_args - @_deprecate_method(version="1.0", message="Use `list_repo_tree` and `get_paths_info` instead.") + @_deprecate_method(version="0.23", message="Use `list_repo_tree` and `get_paths_info` instead.") def list_files_info( self, repo_id: str,