Spaces:
Paused
Paused
Download start.sh from arudradey/agent-loop: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/spaces/arudradey/agent-loop/resolve/main/start.sh
- Command line
-
hf download hf://spaces/arudradey/agent-loop/start.sh
-
curl -L -o start.sh https://huggingface.co/spaces/arudradey/agent-loop/resolve/main/start.sh
509 Bytes
| set -e | |
| # Gracefully wait if port 7860 is momentarily occupied by a previous process | |
| for i in {1..10}; do | |
| if ! python3 -c "import socket; s = socket.socket(); s.bind(('0.0.0.0', 7860)); s.close()" 2>/dev/null; then | |
| echo "[start.sh] Port 7860 busy, waiting for release (attempt $i/10)..." | |
| fuser -k 7860/tcp 2>/dev/null || true | |
| sleep 1 | |
| else | |
| break | |
| fi | |
| done | |
| echo "[start.sh] Port 7860 is free. Starting Uvicorn on 0.0.0.0:7860..." | |
| exec uvicorn app:app --host 0.0.0.0 --port 7860 | |