Hello,
Iâm using a Google Colab notebook.
This line worked out:
!pip install huggingface_hub
Next, I wanted to write a json-file, which worked out, too:
import json
with open(âmy_language_vocab.jsonâ, âwâ) as vocab_file:
json.dump(vocab_dict, vocab_file)
Then, I ran the following line and got an access token (able to write) from my own account:
from huggingface_hub import notebook_login
notebook_login()
Next, I create a Repository and I can find it when I visit my page:
from huggingface_hub import create_repo
create_repo(âKristinabckr/testpublic2â, private=False)
But if I run this line:
tokenizer.push_to_hub(repo_name) #I tried âKristinabckr/testpublic2â and âtestpublic2â for
#repo_name
I get the following Error:
HTTPError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
212 try:
â 213 response.raise_for_status()
214 except HTTPError as e:
9 frames
HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/api/repos/create
The above exception was the direct cause of the following exception:
RepositoryNotFoundError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name)
240 + â\nIf the repo is private, make sure you are authenticated.â
241 )
â 242 raise RepositoryNotFoundError(message, response) from e
243
244 elif response.status_code == 400:
RepositoryNotFoundError: 401 Client Error. (Request ID: AfU1Ldq9xvEPG6pNZ_3jE)
Repository Not Found for url: https://huggingface.co/api/repos/create.
Please make sure you specified the correct repo_id
and repo_type
.
If the repo is private, make sure you are authenticated.
Unauthorized - Unauthorized