Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download interface/run_backend.sh from SMSD75/SynthScope: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/spaces/SMSD75/SynthScope/resolve/main/interface/run_backend.sh
- Command line
-
hf download hf://spaces/SMSD75/SynthScope/interface/run_backend.sh
-
curl -L -o run_backend.sh https://huggingface.co/spaces/SMSD75/SynthScope/resolve/main/interface/run_backend.sh
1.23 kB
| # Launch the SynthScope interface backend (FastAPI + uvicorn) from the SynthScope conda env. | |
| # | |
| # bash interface/run_backend.sh # serve on 0.0.0.0:8000 | |
| # SYNTHSCOPE_PORT=9000 bash interface/run_backend.sh # custom port | |
| # | |
| # The backend serves the built Vite frontend (interface/frontend/dist) if present, else the | |
| # no-build standalone page (interface/static/index.html). Models load lazily on first request. | |
| set -euo pipefail | |
| # Old AGID_* variables still work: map each to its SYNTHSCOPE_* name unless that is already set. | |
| for _v in $(compgen -e | grep '^AGID_' || true); do _n="SYNTHSCOPE_${_v#AGID_}"; [ -n "${!_n:-}" ] || export "$_n=${!_v}"; done | |
| REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| cd "$REPO_ROOT" | |
| PORT="${SYNTHSCOPE_PORT:-8000}" | |
| HOST="${SYNTHSCOPE_HOST:-0.0.0.0}" | |
| CONDA="${CONDA_EXE:-/home/ssalehi/miniconda3/bin/conda}" | |
| # Caches default to a node-local location (see backend/config.py). Override as needed: | |
| # export SYNTHSCOPE_CKPT_DIR=/path/to/checkpoints | |
| echo "Serving SynthScope interface on http://${HOST}:${PORT} (Ctrl-C to stop)" | |
| exec "$CONDA" run --no-capture-output -n SynthScope \ | |
| uvicorn interface.backend.app:app --host "$HOST" --port "$PORT" "$@" | |