From d7349e1b6fd812bda1ac42de67d81397003ee895 Mon Sep 17 00:00:00 2001 From: Lucain Pouget Date: Tue, 5 Nov 2024 10:02:45 +0100 Subject: [PATCH] Warn about upload_large_folder if really large folder --- src/huggingface_hub/hf_api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/huggingface_hub/hf_api.py b/src/huggingface_hub/hf_api.py index c458eda4f2..a02c6a0eba 100644 --- a/src/huggingface_hub/hf_api.py +++ b/src/huggingface_hub/hf_api.py @@ -9217,7 +9217,8 @@ def _prepare_upload_folder_additions( token=token, ) if len(filtered_repo_objects) > 30: - logger.info( + log = logger.warning if len(filtered_repo_objects) > 200 else logger.info + log( "It seems you are trying to upload a large folder at once. This might take some time and then fail if " "the folder is too large. For such cases, it is recommended to upload in smaller batches or to use " "`HfApi().upload_large_folder(...)`/`huggingface-cli upload-large-folder` instead. For more details, "