First, create a new secret. In this case, we will use HF_TOKEN but you can name whatever you want.
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.")
The above is the detailed content of HuggingFace login on Google Colab. For more information, please follow other related articles on the PHP Chinese website!