SergeyO7's picture
Create app2chk
b8c02a1 verified
raw
history blame
277 Bytes
import os
from huggingface_hub import login
# Retrieve the HF token from the environment variables
hf_token = os.getenv("HF_TOKEN")
if hf_token is None:
raise ValueError("HF_TOKEN is not set in the environment variables.")
# Use the token to log in
login(token=hf_token)