gpt-wiki-az / push_to_hf.py
IsmatS's picture
Upload folder using huggingface_hub
463c2c1 verified
raw
history blame
418 Bytes
import os
from dotenv import load_dotenv
from huggingface_hub import login, HfApi
# Load the Hugging Face token from .env
load_dotenv()
hf_token = os.getenv("HUGGINGFACE_TOKEN")
# Log in to Hugging Face
login(token=hf_token)
# Define your repository ID
repo_id = "IsmatS/gpt-wiki-az"
# Initialize HfApi and upload the model folder
api = HfApi()
api.upload_folder(folder_path="./", path_in_repo="", repo_id=repo_id)