question_qualifier / huggingface.py
dp1345's picture
added files
e392014 verified
raw
history blame contribute delete
492 Bytes
from huggingface_hub import login
import os
from dotenv import load_dotenv
load_dotenv()
# Make sure you have set your token as an environment variable
# e.g., in your terminal: export HUGGINGFACEHUB_API_TOKEN="your_token_here"
token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
if not token:
raise ValueError("Please set the environment variable HUGGINGFACEHUB_API_TOKEN")
# Login programmatically
login(token=token)
print("✅ Logged in to Hugging Face Hub successfully!")