hugging face error uploading dataset or model - getting http status: 403 / 416

Sometimes when working with hugging face from colab and you find yourself having to push dataset or model to hugging face repository, you might run into this error :-

403 Forbidden: Forbidden: you must use a write token to upload to a repository. 

Or this could be a 416 at times.

I have login multiple times and yet i still bump into this error. I even try setting HF_TOKEN environment variable in google colab yet still end up with this error.

login("hf_your-write-token")


To resolve this error, you can use the following code. Let's say you're uploading dataset, you can do this


dataset.push_to_hub("kepung/hellodataset",
token="hf_write-token")

where kepung is my profile name and dataset is called hellodataset. Include the write token here. 










Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type