Download instability , disconnects

I’ve been expriencing this issue with different llms, also with stable diffusion, see below, been trying to download the whole morning, something that should be 5-10 mintues (I have a stable 1GB connection, wired, no issues with other sites or services).
rror while downloading from 6a-iSg~MqmSrYs3uz6cqIXBpv8yoKOg__&Key-Pair-Id=K24J24Z295AEI9: HTTPSConnectionPool(host=‘cdn-lfs-us-1.hf.co’, port=443): Read timed out.
Trying to resume download…

model-00001-of-00002.safetensors: 27%|█████████████▉ | 1.27G/4.65G [00:00<?, ?B/s]

File “D:\anaconda\envs\omost\lib\site-packages\requests\models.py”, line 826, in generate
raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host=‘cdn-lfs-us-1.hf.co’, port=443): Read timed out.

1 Like

Hi there! The issue you’re experiencing with downloading models from the Hugging Face CDN could stem from a few different factors, even with a stable internet connection. Here are some steps and suggestions to help resolve it:

1. Retry the Download

  • The Hugging Face CDN might be experiencing temporary server-side issues. Often, simply retrying the download later can help.

2. Use the hf_transfer Library

  • Hugging Face has a tool called hf_transfer for more robust downloads. It supports resuming and retries automatically. Install it with:
    pip install hf_transfer
    
    Then, download your model using:
    hf_transfer download <model_url>
    

3. Increase Timeout and Retry Settings

  • If you’re using the transformers or diffusers library, you can increase the timeout and retry settings by modifying the environment variables:
    export HF_HUB_ENABLE_EMERGENCY_RETRY=True
    export HF_HUB_EMERGENCY_RETRY_WAIT_TIME=10
    
    This will enable retries with longer wait times.

4. Switch to a Different Network Region

  • If possible, try using a VPN or connecting to a different server region. Sometimes, the CDN performance varies by location, and switching regions can improve download speeds.

5. Manually Download the Model

  • You can manually download the model files directly from the Hugging Face website:
    1. Go to the model’s page on Hugging Face.
    2. Click on the individual .safetensors files to download them.
    3. Place the downloaded files in the correct folder within your ~/.cache/huggingface/transformers directory to avoid re-downloading.

6. Verify Storage and File System

  • Ensure that your local disk has enough space and is functioning properly. Large models like these require sufficient disk space and a fast read/write disk.

7. Contact Hugging Face Support

  • If the issue persists, consider reporting it to Hugging Face by creating an issue on their GitHub repository (Hugging Face Hub Issues) or reaching out on their forums. Include the error logs and details about your setup.

Debugging Checklist

  • Stable internet connection :heavy_check_mark:
  • Latest version of libraries (transformers, diffusers, etc.) :heavy_check_mark:
  • Enough disk space :heavy_check_mark:

Let me know if any of these steps help or if you need more detailed guidance! :rocket:

1 Like

sounds promising, will try it tomorrow!

1 Like

so, this didn’t seem to help me much on my system, using anaconda on win10.
many disconnects and speeds all over the place, but under 5Mb/s on average.

tried writing my own requests script with retires, but this also is limited, is this a hf issue?

1 Like

seems like it is machine related, on the macbook, not issues, on the high end workstation, cannot download more than 100 mb at a time before i get errors.

1 Like