Issue You must be authenticated to access it in Pycharm

#124
by Davidfer066 - opened

Good morning.
Im trying to use MistralAI in pycharm, but when I put the code to work and download the AI, it appears this error, telling me that I must be authenticated to access it.
I would appreciate a solution.
Thank you very much.

Regards.
Screenshot 2024-05-14 124117.png

Hi David!
1st: Go to the Mistral model (The version you want to use) on Hugging Face then click on "Agree and accept repository".

2nd: Execute these two lines:
!pip install --upgrade huggingface_hub
!huggingface-cli login --token $HUGGING_FACE_TOKEN

Hello Ahmed.
Thanks for your response.
I have just did that, and it keeps telling me the same error.
When I put huggingface-cli login --token $HUGGING_FACE_TOKEN it tells me this:
huggingface-cli login --token $HUGGING_FACE_TOKEN
usage: huggingface-cli [] login [-h] [--token TOKEN] [--add-to-git-credential]
huggingface-cli [] login: error: argument --token: expected one argument

I don´t know what to do.
Thanks again for responding my message.
Regards.

Make sure there's no spaces between the letters in your access token and no more than one space between the "--token" argument and the HF_TOKEN.

When running huggingface-cli login --token $HUGGING_FACE_TOKEN
huggingface-cli [] login: error: argument --token: expected one argument

This is assuming that $HUGGING_FACE_TOKEN has some value, but now it is empty. From where do we get $HUGGING_FACE_TOKEN?

Hi! I had this issue too, turns out the Hugging Face Token I am using needed to be on "write" access. After changing that, it all works again

  1. pip install huggingface_hub
  2. huggingface-cli login

it will ask you for a token
go to

https://huggingface.co/settings/tokens

it will have an option to generate a token
make sure you click the checkboxes for APIs
generate the token
copy it

go back to the terminal at the top
paste.

Sign up or log in to comment