Spaces:
Sleeping
Sleeping
File size: 810 Bytes
931223d 52cf52c 931223d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # upload_space.py - Upload code to HuggingFace Space (excluding large model files)
from huggingface_hub import upload_folder
import os
print("Uploading ElephMind API to HuggingFace Space...")
print("(Model will be downloaded from Hub at runtime)")
# Determine the server directory (where this script lives)
server_dir = os.path.dirname(os.path.abspath(__file__))
print(f"Uploading directory: {server_dir}")
upload_folder(
folder_path=server_dir,
repo_id="issoufzousko07/elephmind-api",
repo_type="space",
ignore_patterns=["models/*", "*.pyc", "__pycache__", "*.db", "storage/*", "data_storage/*", ".env", "venv", ".git", ".idea"]
)
print("[OK] Upload complete!")
print("Your Space should start building at: https://huggingface.co/spaces/issoufzousko07/elephmind-api")
|