environment variable `HUGGINGFACEHUB_API_TOKEN` os.env missing in the code

#2
by dgsaibal - opened

While running the code getting following error
Did not find huggingfacehub_api_token, please add an environment variable HUGGINGFACEHUB_API_TOKEN which contains it, or pass huggingfacehub_api_token as a named parameter. (type=value_error)

Looks like the environment variable is missing in the code. Help please.

image.png

You can just go to your Hugging Face's settings, generate a token, and add the following line on your code:
os.environ["HUGGINGFACEHUB_API_TOKEN"] = "YOUR _TOKEN"

Owner

Hi,

Do you encounter this issue when using the original HF space (cvachet/pdf-chatbot), or when duplicating this space? I wonder if there is a difference as a space owner or external user. I included this environment variable (HUGGINGFACEHUB_API_TOKEN) as a HuggingFace secret, following this documentation:
https://huggingface.co/docs/hub/spaces-overview#managing-secrets

Sign up or log in to comment