Skip to content

Commit d2927d2

Browse files
Update src/huggingface_hub/utils/tqdm.py
Co-authored-by: Célina <[email protected]>
1 parent 68f0b1a commit d2927d2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/huggingface_hub/utils/tqdm.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,16 @@ def are_progress_bars_disabled(name: Optional[str] = None) -> bool:
199199

200200

201201
def is_tqdm_disabled(log_level: int) -> Optional[bool]:
202+
"""
203+
Determine if tqdm progress bars should be disabled based on logging level and environment settings.
204+
205+
see https://github.com/huggingface/huggingface_hub/pull/2000 and https://github.com/huggingface/huggingface_hub/pull/2698.
206+
"""
202207
if log_level == logging.NOTSET:
203208
return True
204209
if os.getenv("TQDM_POSITION") == "-1":
205210
return False
206211
return None
207-
# ^ set `disable=None` rather than `disable=False` by default to disable progress bar when no TTY attached
208-
# see https://github.com/huggingface/huggingface_hub/pull/2000
209212

210213

211214
class tqdm(old_tqdm):

0 commit comments

Comments
 (0)