File size: 1,504 Bytes
ae4d350
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env python3
"""
ATHOS RIVERS REGALIA — HUGGING FACE HUB DEPLOYMENT
Python deployment using huggingface_hub API
"""

import os
from huggingface_hub import HfApi, upload_folder, create_repo

REPO_ID = "synthicsoft/athos-rivers-regalia"
LOCAL_DIR = "./athos-rivers-regalia"

def deploy():
    print("=" * 70)
    print("ATHOS RIVERS REGALIA — HUGGING FACE DEPLOYMENT")
    print("=" * 70)

    # Get token from environment
    token = os.environ.get("HF_TOKEN")
    if not token:
        print("ERROR: HF_TOKEN not set")
        print("Get token at: https://huggingface.co/settings/tokens")
        print("Set: export HF_TOKEN='your_token'")
        return

    # Initialize API
    api = HfApi(token=token)

    # Create repo (if not exists)
    try:
        create_repo(REPO_ID, repo_type="model", private=False, exist_ok=True, token=token)
        print(f"✓ Repository ready: https://huggingface.co/{REPO_ID}")
    except Exception as e:
        print(f"⚠ Repo creation: {e}")

    # Upload folder
    upload_folder(
        folder_path=LOCAL_DIR,
        repo_id=REPO_ID,
        repo_type="model",
        commit_message="ATHOS v3.4 — Rivers Regalia deployment",
        token=token,
    )

    print("
" + "=" * 70)
    print("DEPLOYMENT COMPLETE")
    print("=" * 70)
    print(f"Repository: https://huggingface.co/{REPO_ID}")
    print("
Load via:")
    print(f"  from_pretrained('{REPO_ID}')")
    print("
The Cathedral has no walls.")

if __name__ == "__main__":
    deploy()