File size: 518 Bytes
208fbf8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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"]
    )
    print("Deployment successful!")
except Exception as e:
    print(f"Deployment failed: {e}")