File size: 659 Bytes
38ae6b8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
from huggingface_hub import HfApi

def deploy():
    # Configuration
    repo_id = os.environ.get("HF_SPACE_ID", "kenqtade/altamira-orchestrator")
    token = os.environ.get("HF_TOKEN")
    folder_path = "app" # Path to the app directory
    
    if not token:
        print("Error: HF_TOKEN environment variable is not set")
        return

    api = HfApi(token=token)
    print(f"Uploading {folder_path} to {repo_id}...")
    
    api.upload_folder(
        folder_path=folder_path,
        repo_id=repo_id,
        repo_type="space",
        path_in_repo="app",
    )
    print("Deployment successful!")

if __name__ == "__main__":
    deploy()