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

Slow download from HuggingFace Hub (capped at 10.5 MB/s) #1886

Open
Andrei-Aksionov opened this issue Dec 23, 2024 · 3 comments
Open

Slow download from HuggingFace Hub (capped at 10.5 MB/s) #1886

Andrei-Aksionov opened this issue Dec 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Andrei-Aksionov
Copy link
Collaborator

Bug description

Sometimes the download speed is pretty slow, no more than 10.5 MB/s.
For example, gemma-2-2b takes a lot of time to download.

In download.py the code sets hf_transfer variable via constants:

if _HF_TRANSFER_AVAILABLE and not previous:
print("Setting HF_HUB_ENABLE_HF_TRANSFER=1")
constants.HF_HUB_ENABLE_HF_TRANSFER = True
download.HF_HUB_ENABLE_HF_TRANSFER = True

But it doesn't help.
Even if set the value through os.environ["HF_HUB_ENABLE_HF_TRANSFER"]="1".

But, if to export the env variable before running a script one can notice a significant speed-up:

export HF_HUB_ENABLE_HF_TRANSFER=1

Most likely, HF Hub checks the env variable upon initialization.
The code needs to be fixed.

What operating system are you using?

macOS

LitGPT Version

Version: 0.5.4.dev1
@Andrei-Aksionov Andrei-Aksionov added the bug Something isn't working label Dec 23, 2024
@rasbt
Copy link
Collaborator

rasbt commented Jan 8, 2025

I think this is fixed now via #1899

@rasbt rasbt closed this as completed Jan 8, 2025
@Andrei-Aksionov
Copy link
Collaborator Author

Nope :)
Still the same: the downloading speed is capped at 10.5, but if I enable HF_HUB_ENABLE_HF_TRANSFER before downloading it is superfast.

@rasbt rasbt reopened this Jan 9, 2025
@rasbt
Copy link
Collaborator

rasbt commented Jan 9, 2025

So weird, I wasn't able to reproduce!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants