I’ve double-checked that self.hf_token is copied correctly from my Hugging Face account, and it has all necessary permissions (API access and Inference endpoint usage).
Additionally, when I try running: huggingface-cli login
I also get an error (it doesn’t let me log in).
Has anyone encountered this before?
Is there something else I need to set up, or any known issues with inference tokens?
Judging from the error message, it is possible that the token is really invalid. Or perhaps the necessary permissions have not been granted to the token…?
Mine is just a READ token.
from huggingface_hub import get_inference_endpoint
url = "https://huggingface.co/"
endpoint_name = 'Qwen/QwQ-32B'
HF_TOKEN = "hf_my_pro_token"
try:
endpoint = get_inference_endpoint(endpoint_name, token=HF_TOKEN)
except Exception as e:
print(e)
# 404 Client Error: Not Found for url: https://api.endpoints.huggingface.cloud/v2/endpoint/John6666/Qwen/QwQ-32B (Request ID:
HF_TOKEN = "foobar"
endpoint = get_inference_endpoint(endpoint_name, token=HF_TOKEN)
# raise HTTPError(error_message, request=e.request, response=e.response) from e
# requests.exceptions.HTTPError: Invalid user token.