I understand the confusion this has caused, I’m surprised to see that this was not mentioned in this particular course. However, in the other short courses, it is mentioned how you can use your own API key. (And to answer your original query), the HF_API_KEY has been setup within the environment of the course, which is why it works on the platform, but the fails when you run it locally, as you don’t have the exact same environment in your local system.
This Hugging face hfapi git should help you run your own HF API.
I went to the link in your note and ran the following:
client = hfapi.Client()
‘client’ variable seems to have the api key as I can run the various tasks…however, I am still wondering how can I set it up in my environment so I can pass api keys and endpoint url (HF_API_KEY, ENDPOINT_URL=os.environ[‘HF_API_ITT_BASE’]) from my os.environ
I was also confused by this. I think the instructions in the notebook could be a little clearer.
The first line of the markdown says load in HF API key- so I went looking to create a key on HF’s website and substituted that (and it didn’t work because I think I created the wrong key but I digress)…it might be clearer to say load in the API key that has been pre-set as an environment variable for you as when I printed it I realised there was one already.