Download model-4/scripts/run.sh from Jyo-K/PoPTard5: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/Jyo-K/PoPTard5/resolve/main/model-4/scripts/run.sh
- Command line
-
hf download hf://Jyo-K/PoPTard5/model-4/scripts/run.sh
-
curl -L -o run.sh https://huggingface.co/Jyo-K/PoPTard5/resolve/main/model-4/scripts/run.sh
1.2 kB
| # Usage: scripts/run.sh start|status|stop|logs|tail <stage> (prefix with M4_SMOKE=1 for the smoke run) | |
| # The runner is detached (setsid, own process group) so it survives SSH disconnects; "start" again resumes. | |
| set -euo pipefail | |
| cd "$(dirname "$0")/.." | |
| PY="$PWD/.venv/bin/python" | |
| W=work; [ "${M4_SMOKE:-0}" = "1" ] && W=work_smoke | |
| mkdir -p "$W/logs" "$W/state" | |
| PIDF="$W/state/pipeline.pid" | |
| alive() { [ -f "$PIDF" ] && kill -0 "$(cut -d' ' -f1 "$PIDF")" 2>/dev/null; } | |
| case "${1:-}" in | |
| start) | |
| if alive; then echo "already running (pid $(cut -d' ' -f1 "$PIDF"))"; exit 0; fi | |
| setsid -f "$PY" -u src/run_pipeline.py "${@:2}" >> "$W/logs/pipeline.out" 2>&1 < /dev/null | |
| sleep 3; alive && echo "started pid $(cut -d' ' -f1 "$PIDF")" || { echo "failed to start"; tail -5 "$W/logs/pipeline.out"; } ;; | |
| status) alive && echo "RUNNING" || echo "not running"; (cd src && "$PY" run_pipeline.py --status) ;; | |
| stop) alive && kill -- -"$(cut -d' ' -f2 "$PIDF")" && echo stopped || echo "not running" ;; | |
| logs) tail -n "${2:-40}" "$W/logs/pipeline.out" ;; | |
| tail) tail -n "${3:-40}" "$W/logs/$2.log" ;; | |
| *) echo "usage: $0 start|status|stop|logs|tail <stage>"; exit 1 ;; | |
| esac | |