Skip to content

Commit 09d17ec

Browse files
authored
Have logging affect bars (#297)
1 parent f623b8b commit 09d17ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/huggingface_hub/repository.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ def lfs_log_progress():
160160
This is a context manager that will log the Git LFS progress of cleaning, smudging, pulling and pushing.
161161
"""
162162

163+
if logger.getEffectiveLevel() >= logging.ERROR:
164+
try:
165+
yield
166+
finally:
167+
return
168+
163169
def output_progress(stopping_event: threading.Event):
164170
"""
165171
To be launched as a separate thread with an event meaning it should stop the tail.
@@ -467,7 +473,7 @@ def clone_from(self, repo_url: str, use_auth_token: Union[bool, str, None] = Non
467473
if in_repository:
468474
if is_local_clone(self.local_dir, repo_url):
469475
logger.warning(
470-
f"{self.local_dir} is already a clone of {clean_repo_url}. Make sure you pull the latest"
476+
f"{self.local_dir} is already a clone of {clean_repo_url}. Make sure you pull the latest "
471477
"changes with `repo.git_pull()`."
472478
)
473479
else:

0 commit comments

Comments
 (0)