FLUX.1-Depth-dev / _push.py
privacyzer0's picture
Upload folder using huggingface_hub
60face4 verified
Raw
History Blame Contribute Delete
648 Bytes
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")