File size: 703 Bytes
b112551
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Publish this folder as a static Hugging Face Space (free tier: no build, no server)."""
import os
import sys

from huggingface_hub import HfApi

ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SPACE = sys.argv[1] if len(sys.argv) > 1 else "coralexbadea/BackdoorChecker"

api = HfApi()
api.create_repo(SPACE, repo_type="space", space_sdk="static", exist_ok=True)
api.upload_folder(
    repo_id=SPACE, repo_type="space", folder_path=ROOT,
    ignore_patterns=["calibration/logs/*", "calibration/cards/*", "**/__pycache__/*", "*.pyc", ".git/*"],
    commit_message="Backdoor Checker v0.1.0: scanner, validation results, leaderboard",
)
print(f"https://huggingface.co/spaces/{SPACE}")