Spaces:
Sleeping
Sleeping
Download bootstrap.py from muhalwan/ml-model-hub: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/spaces/muhalwan/ml-model-hub/resolve/main/bootstrap.py
- Command line
-
hf download hf://spaces/muhalwan/ml-model-hub/bootstrap.py
-
curl -L -o bootstrap.py https://huggingface.co/spaces/muhalwan/ml-model-hub/resolve/main/bootstrap.py
569 Bytes
| import os | |
| import sys | |
| from huggingface_hub import snapshot_download | |
| token = os.environ.get("HF_TOKEN") | |
| if not token: | |
| print("Error: HF_TOKEN environment variable is not set.", file=sys.stderr) | |
| sys.exit(1) | |
| print("Synchronizing application assets from secure storage...") | |
| snapshot_download( | |
| repo_id="muhalwan/mlnexus-private-core", | |
| repo_type="dataset", | |
| token=token, | |
| local_dir="/code" | |
| ) | |
| print("Starting application server...") | |
| os.execv( | |
| sys.executable, | |
| [sys.executable, "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |
| ) | |