DEV Community

0xkoji
0xkoji

Posted on

3

HuggingFace login on Google Colab

Step1. Create a secret in Secrets

First, create a new secret. In this case, we will use HF_TOKEN but you can name whatever you want.

Colab Secrets

Step2. Load a secret and log in to Hugging Face

from huggingface_hub import login
from google.colab import userdata
HF_TOKEN=userdata.get('HF_TOKEN')

if HF_TOKEN:
    login(HF_TOKEN)
    print("Successfully logged in to Hugging Face!")
else:
    print("Token is not set. Please save the token first.")
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Image of Docusign

πŸ› οΈ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more