Spaces:
Paused
Paused
Download deploy.py from jynxzio5/onlinefix-api: direct link, hf CLI and curl.
- Browser
- Download file 953 Bytes
-
https://huggingface.co/spaces/jynxzio5/onlinefix-api/resolve/main/deploy.py
- Command line
-
hf download hf://spaces/jynxzio5/onlinefix-api/deploy.py
-
curl -L -o deploy.py https://huggingface.co/spaces/jynxzio5/onlinefix-api/resolve/main/deploy.py
953 Bytes
| import os | |
| import sys | |
| from huggingface_hub import HfApi | |
| script_dir = os.path.dirname(os.path.abspath(__file__)) | |
| repo_id = "jynxzio5/onlinefix-api" | |
| print(f"==================================================") | |
| print(f" Deploying Standalone OnlineFix API Microservice") | |
| print(f" Source: {script_dir}") | |
| print(f" Target Space: {repo_id}") | |
| print(f"==================================================") | |
| try: | |
| api = HfApi() | |
| api.create_repo(repo_id=repo_id, repo_type="space", space_sdk="docker", exist_ok=True) | |
| api.upload_folder( | |
| folder_path=script_dir, | |
| repo_id=repo_id, | |
| repo_type="space", | |
| commit_message="Deploy standalone OnlineFix catalog API microservice" | |
| ) | |
| print("\nSUCCESS: Standalone OnlineFix API deployed to HuggingFace Space!") | |
| print(f"Live Base URL: https://jynxzio5-onlinefix-api.hf.space") | |
| except Exception as e: | |
| print(f"\nERROR Deploying to HuggingFace Space: {e}") | |
| sys.exit(1) | |