Private data and wget?

I used wget to retrieve data from my space on colab. It worked as long as it was public, but I made it private so it now no longer works. How do I insert a passcode, or PAT as I had to do with github?

edit: Let me add I have tried this but I get invalid user/password (even though the UAT is 100% valid) " https://USER:*password*@huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip"

You need to add the authorization header to wget:

wget --header="Authorization: Bearer <HF_TOKEN>" hf/file/download/url

(replace <HF_TOKEN> with your HF token)

3 Likes

I don’t understand. Instead of the https://USER:xxxxxx/xxxx/xx.zip above, I replace that with --header=“Authorization: Bearer <HF_TOKEN>” then “https://huggingface.co/datasets/GeneralAwareness/Various/blob/main/file.zip” where the HF_TOKEN is one that I created?

hi @GeneralAwareness here is the command, replace HF_TOKEN with a read token

wget  --header="Authorization: Bearer HF_TOKEN" https://huggingface.co/datasets/GeneralAwareness/Various/resolve/main/file.zip
1 Like

Good, I did understand afterall.

Thank you everyone.

1 Like

I have a follow-up question. I am trying to load some of the ShapeNetCore zip files (I have gotten access) in colab, but using Hugging Face login fails. Another person suggested the above approach. Is there a way to access my token after I login and pass it into the header? I have used .env files in VSC, but not sure of best practices in colab.