Spaces:
Running
Running
Download scripts/publish.py from coralexbadea/BackdoorChecker: direct link, hf CLI and curl.
- Browser
- Download file 703 Bytes
-
https://huggingface.co/spaces/coralexbadea/BackdoorChecker/resolve/main/scripts/publish.py
- Command line
-
hf download hf://spaces/coralexbadea/BackdoorChecker/scripts/publish.py
-
curl -L -o publish.py https://huggingface.co/spaces/coralexbadea/BackdoorChecker/resolve/main/scripts/publish.py
703 Bytes
| """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}") | |