Spaces:
Running
Running
Download scripts/hf_start.sh from 2026worldcup/predictor: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/spaces/2026worldcup/predictor/resolve/main/scripts/hf_start.sh
- Command line
-
hf download hf://spaces/2026worldcup/predictor/scripts/hf_start.sh
-
curl -L -o hf_start.sh https://huggingface.co/spaces/2026worldcup/predictor/resolve/main/scripts/hf_start.sh
617 Bytes
| set -euo pipefail | |
| ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" | |
| API_PORT="${API_PORT:-8000}" | |
| export API_BACKEND="${API_BACKEND:-http://127.0.0.1:${API_PORT}}" | |
| export PORT="${PORT:-7860}" | |
| cleanup() { | |
| if [ -n "${API_PID:-}" ]; then kill "$API_PID" 2>/dev/null || true; fi | |
| if [ -n "${WEB_PID:-}" ]; then kill "$WEB_PID" 2>/dev/null || true; fi | |
| } | |
| trap cleanup EXIT INT TERM | |
| cd "$ROOT/services/api" | |
| python -m uvicorn main:app --host 127.0.0.1 --port "$API_PORT" --log-level warning & | |
| API_PID="$!" | |
| cd "$ROOT/apps/web" | |
| npm run start:render & | |
| WEB_PID="$!" | |
| wait -n "$API_PID" "$WEB_PID" | |