advanced-reasoning / upload_to_hub.py
nananie143's picture
Upload folder using huggingface_hub
dcb2a99 verified
raw
history blame
676 Bytes
from huggingface_hub import HfApi
import os
# Initialize the Hugging Face API
api = HfApi()
print("Starting upload to Hugging Face Space...")
# Create a new Space if it doesn't exist
try:
api.create_repo(
repo_id="nananie143/advanced-reasoning",
repo_type="space",
space_sdk="gradio",
private=False
)
except Exception as e:
print(f"Space might already exist or there was an error: {e}")
# Upload the files
api.upload_folder(
folder_path=".",
repo_id="nananie143/advanced-reasoning",
repo_type="space",
ignore_patterns=["*.pyc", "__pycache__", ".git", ".env", "*.gguf"]
)
print("Upload completed successfully!")