portfolio_opt / deploy.py
engineportf's picture
Upload folder using huggingface_hub
b9897f5 verified
Raw
History Blame Contribute Delete
580 Bytes
import os
from huggingface_hub import HfApi
api = HfApi(token=os.getenv("HF_TOKEN"))
print("Deploying to HuggingFace Space: engineportf/portfolio_opt...")
try:
api.upload_folder(
folder_path=".",
repo_id="engineportf/portfolio_opt",
repo_type="space",
ignore_patterns=["*.pyc", "__pycache__/*", ".git/*", ".env", "AI_NOTES.md", "PortableGit/*", "PortableGit", "*.pkl", "*.db", "output/*", ".mypy_cache/*", "hf_upload.py"]
)
print("Deployment successful!")
except Exception as e:
print(f"Deployment failed: {e}")