Building Gen AI Applications with Gradio

Hi Team,

I’m trying to run the training material in my local Jupyter notebook but I’m stuck with the below error.

Cell In[8], line 8
6 from dotenv import load_dotenv, find_dotenv
7 _ = load_dotenv(find_dotenv()) # read local .env file
----> 8 hf_api_key = os.environ[‘HF_API_KEY’]

KeyError: ‘HF_API_KEY’

Thanks Viviana

Generate this key from hugging face portal and store it in your bash_profile.

export HF_API_KEY = <your generated key on hugging face website>