Download scripts/deploy_spaces.py from Sowaiba01/ThoraxNet: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/spaces/Sowaiba01/ThoraxNet/resolve/main/scripts/deploy_spaces.py
- Command line
-
hf download hf://spaces/Sowaiba01/ThoraxNet/scripts/deploy_spaces.py
-
curl -L -o deploy_spaces.py https://huggingface.co/spaces/Sowaiba01/ThoraxNet/resolve/main/scripts/deploy_spaces.py
480 Bytes
| """Push latest code to HuggingFace Spaces for deployment.""" | |
| import os | |
| from huggingface_hub import HfApi | |
| api = HfApi() | |
| repo_id = os.environ.get("HF_SPACES_REPO", "YOUR_USERNAME/chestai") | |
| token = os.environ["HF_TOKEN"] | |
| api.upload_folder( | |
| folder_path=".", | |
| repo_id=repo_id, | |
| repo_type="space", | |
| token=token, | |
| ignore_patterns=["*.pyc", "__pycache__", ".git", "frontend/node_modules", "notebooks/"], | |
| ) | |
| print(f"Deployed to https://huggingface.co/spaces/{repo_id}") | |