File size: 745 Bytes
229fcc3 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | from huggingface_hub import create_repo, upload_folder
import os
# Set your Hugging Face repo details here
repo_id = "Jagadeesh9580/unlearn" # 👈 update this if needed
local_folder = "./results" # Local folder to push
repo_type = "model" # It's a model repo
# Check if folder exists
if not os.path.exists(local_folder):
raise ValueError(f"Local folder '{local_folder}' does not exist!")
# 2. Upload the folder
upload_folder(
folder_path=local_folder,
path_in_repo="seg", # Inside Hugging Face repo -> under /results
repo_id=repo_id,
repo_type=repo_type,
commit_message="Uploading results 🚀",
)
print(f"✅ Successfully pushed '{local_folder}' to Hugging Face repo '{repo_id}'!") |