Spaces:
Runtime error
Runtime error
Download bin/run_server.sh from Rushhaabhhh/HONEST-RL-Calibrator: direct link, hf CLI and curl.
- Browser
- Download file 981 Bytes
-
https://huggingface.co/spaces/Rushhaabhhh/HONEST-RL-Calibrator/resolve/main/bin/run_server.sh
- Command line
-
hf download hf://spaces/Rushhaabhhh/HONEST-RL-Calibrator/bin/run_server.sh
-
curl -L -o run_server.sh https://huggingface.co/spaces/Rushhaabhhh/HONEST-RL-Calibrator/resolve/main/bin/run_server.sh
981 Bytes
| # bin/run_server.sh — start the HONEST-Env FastAPI server locally for development/testing | |
| set -euo pipefail | |
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
| PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" | |
| VENV="$PROJECT_ROOT/venv" | |
| if [[ ! -d "$VENV" ]]; then | |
| echo "ERROR: virtualenv not found at $VENV. Run: python3 -m venv venv && venv/bin/pip install -r requirements.txt" >&2 | |
| exit 1 | |
| fi | |
| HOST="${HOST:-0.0.0.0}" | |
| PORT="${PORT:-8000}" | |
| WORKERS="${WORKERS:-1}" | |
| LOG_LEVEL="${LOG_LEVEL:-info}" | |
| echo "Starting HONEST-Env server on http://${HOST}:${PORT} ..." | |
| echo " Docs: http://localhost:${PORT}/docs" | |
| echo " Health: http://localhost:${PORT}/health" | |
| echo " Metadata: http://localhost:${PORT}/metadata" | |
| echo " Schema: http://localhost:${PORT}/schema" | |
| echo "" | |
| cd "$PROJECT_ROOT" | |
| exec "$VENV/bin/uvicorn" server.app:app \ | |
| --host "$HOST" \ | |
| --port "$PORT" \ | |
| --workers "$WORKERS" \ | |
| --log-level "$LOG_LEVEL" \ | |
| --reload | |