basic_agent / huggingface.py
techy-ai
basic agent
47bae79
raw
history blame
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!")