diff --git a/src/datasets/utils/tqdm.py b/src/datasets/utils/tqdm.py index e28a8ff7ccf..3494c5d7da4 100644 --- a/src/datasets/utils/tqdm.py +++ b/src/datasets/utils/tqdm.py @@ -40,6 +40,7 @@ ``` """ +import os import warnings from tqdm.auto import tqdm as old_tqdm @@ -111,6 +112,9 @@ class tqdm(old_tqdm): def __init__(self, *args, **kwargs): if are_progress_bars_disabled(): kwargs["disable"] = True + elif kwargs.get("disable") is None and os.getenv("TQDM_POSITION") == "-1": + # Force-enable progress bars in cloud environments when disable=None + kwargs["disable"] = False super().__init__(*args, **kwargs) def __delattr__(self, attr: str) -> None: