To be able to interact with the Hugging Face community, you need to create an API token. Let's take a look at the steps.
Sign up for Hugging Face
If you haven't gotten an account yet, sign up here: https://huggingface.co/joinHover over the account icon in the upper right corner and choose "settings"
From the left menu, choose "Access Tokens"
Then, choose "Create New Token"
For most cases, I choose "Fine-grained" and give it these three permissions:
Copy the token and store it somewhere safe (don't worry I've deleted the token from the screenshot below).
Store the Token in a Google Colab Notebook
Cool! You now have access to Hugging Face repos via this token. But how do you use the token? Well, in a Google Colab notebook, you do the following:
Select the key icon.
Select "Add new secret".
Use the following:
Name:HF_TOKEN
Value:[your token]
Then select the toggle to grant "Notebook access"
From within a code block you can now access the token like this:
userdata.get('HF_TOKEN')
The Unexpectedly Simple 5 Steps to Build Your First LLM-Powered Chatbot
Want to jump into AI development, but not sure where to start? I've created a free guide with 5 simple steps that will guide you step by step to build your own custom chatbot backed by an LLM.
Get My Free Guide