Spaces:
Sleeping
Sleeping
Download scripts/run_server.sh from Ayush-Singh/structural_design_env: direct link, hf CLI and curl.
- Browser
- Download file 696 Bytes
-
https://huggingface.co/spaces/Ayush-Singh/structural_design_env/resolve/main/scripts/run_server.sh
- Command line
-
hf download hf://spaces/Ayush-Singh/structural_design_env/scripts/run_server.sh
-
curl -L -o run_server.sh https://huggingface.co/spaces/Ayush-Singh/structural_design_env/resolve/main/scripts/run_server.sh
696 Bytes
| set -euo pipefail | |
| # Reliable server launcher for environments without system python/uvicorn. | |
| HOST="${HOST:-0.0.0.0}" | |
| PORT="${PORT:-7866}" | |
| RELOAD="${RELOAD:-false}" | |
| ENABLE_WEB_INTERFACE="${ENABLE_WEB_INTERFACE:-false}" | |
| CMD=( | |
| uv run --no-project | |
| --with fastapi | |
| --with uvicorn | |
| --with pydantic | |
| --with numpy | |
| python -m uvicorn server.app:app | |
| --host "${HOST}" | |
| --port "${PORT}" | |
| ) | |
| if [[ "${RELOAD}" == "true" ]]; then | |
| CMD+=(--reload) | |
| fi | |
| # Pass through extra CLI args to uvicorn. | |
| CMD+=("$@") | |
| echo "Starting structural-design-env server on ${HOST}:${PORT} (reload=${RELOAD}, web=${ENABLE_WEB_INTERFACE})" | |
| ENABLE_WEB_INTERFACE="${ENABLE_WEB_INTERFACE}" "${CMD[@]}" | |