When copying file from HugginFace to GoogleColab with wget I only get a small size

104 Views Asked by At

I have identified my account in Google Colab by providing a token

    from huggingface_hub import notebook_login
    notebook_login()

then I would like to copy this 6.5 Go file :

    !wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors

Unfortunately it gets only 53K

enter image description here

Is there a way to overcome this limitation ?

1

There are 1 best solutions below

0
On

Here is the fix I have found : Registering a token from HuggingFace to Google Colab, then use hf_hub_url function to get the right url

from huggingface_hub import notebook_login
notebook_login()
from huggingface_hub import hf_hub_url

myPath=  hf_hub_url(
    repo_id="stabilityai/stable-diffusion-xl-base-1.0", filename="sd_xl_base_1.0.safetensors"
)
!wget $myPath