File size: 648 Bytes
0917a50
 
 
 
 
 
 
 
 
 
60face4
0917a50
 
60face4
0917a50
60face4
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import os
from huggingface_hub import HfApi

TOKEN = os.environ["HF_TOKEN"]
REPO = "privacyzer0/FLUX.1-Depth-dev"
BUILD = "/opt/data/skills/black.forest/space_build"

api = HfApi(token=TOKEN)
api.upload_folder(folder_path=BUILD, repo_id=REPO, repo_type="space", token=TOKEN)
print("UPLOAD_DONE")
# Re-set secret (upload_folder doesn't touch secrets, but ensure present)
try:
    api.add_space_secret(repo_id=REPO, key="HF_TOKEN", value=TOKEN, token=TOKEN)
    print("SECRET_OK")
except Exception as e:
    print("SECRET_SKIP:", str(e)[:120])
# Request a rebuild by touching the repo (HF auto-rebuilds on push; this is a no-op safety)
print("DONE")