Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable tqdm progress in cloud environments #2698

Merged
merged 5 commits into from
Dec 9, 2024

Conversation

cbensimon
Copy link
Contributor

@cbensimon cbensimon commented Dec 6, 2024

Cloud environments usually enable TQDM_POSITION=-1 to disable carriage return and get clean tqdm progress logging

The idea of this PR is to use this environment variable as a hint to force enabling tqdm progress despite the absence of TTY

This will at least re-enable download progress in Spaces

#2000 follow-up

@cbensimon cbensimon requested a review from Wauplin December 6, 2024 14:45
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin Wauplin requested a review from hanouticelina December 6, 2024 14:57
Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for investigating this @cbensimon. Solution looks ok to me 👍
Could you update this line as well please?

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL the nuance between disable=False and disable=None in tqdm.

same comment as @Wauplin about updating src/huggingface_hub/lfs.py#L435. Otherwise looks good to me! thanks @cbensimon!

src/huggingface_hub/utils/tqdm.py Outdated Show resolved Hide resolved
@cbensimon
Copy link
Contributor Author

@Wauplin @hanouticelina done: src/huggingface_hub/lfs.py#L435 has been updated accordingly

Copy link
Contributor

@Wauplin Wauplin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cbensimon !

Copy link
Contributor

@hanouticelina hanouticelina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @cbensimon for the PR!

@hanouticelina hanouticelina merged commit b5a217b into huggingface:main Dec 9, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants