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

Throttle download speed #2118

Open
arch-btw opened this issue Mar 15, 2024 · 1 comment
Open

Throttle download speed #2118

arch-btw opened this issue Mar 15, 2024 · 1 comment

Comments

@arch-btw
Copy link

Is your feature request related to a problem? Please describe.

When downloading a model, huggingface-cli opens many connections and completely maxes out the connection's bandwidth. Because of this, every other process doesn't have any bandwidth left.

Describe the solution you'd like

A command line flag that would allow you to set the maximum download speed.
For example:

huggingface-cli download --downrate 8M

To limit download speed to 8MB/sec.

Describe alternatives you've considered

I've tried bandwidth throttling apps such as trickle, but they don't work with huggingface-cli.

Additional context

I'm using Linux.

@Wauplin
Copy link
Contributor

Wauplin commented Mar 15, 2024

When downloading a model, huggingface-cli opens many connections and completely maxes out the connection's bandwidth. Because of this, every other process doesn't have any bandwidth left.

Hi @arch-btw, this is the case only if you have hf_transfer installed and enabled. hf_transfer is a rust-based package used to maximize the throughput by exploiting many processes in parallel, as you've seen. By default, huggingface-cli uses the simple-threaded requests library which doesn't lead to the situation you've described. I suspect that you have the HF_HUB_ENABLE_HF_TRANSFER environment set to 1. See these docs for more details. If you want to disable it for a single command, you can do

HF_HUB_ENABLE_HF_TRANSFER=0 huggingface-cli download ...

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

No branches or pull requests

2 participants