- #!/bin/bash
- set -euo pipefail
- cd "$(dirname "$0")"
- # Ensure only one mainspacy instance keeps port 12012 (reload/no-reload).
- pkill -f "uvicorn mainspacy:app .*--port 12012" 2>/dev/null || true
- sleep 1
- # Default to low-memory mode. Set ENABLE_BENEPAR=1 to re-enable constituency parser.
- ENABLE_BENEPAR="${ENABLE_BENEPAR:-0}" \
- setsid /root/miniconda3/envs/py311/bin/uvicorn mainspacy:app --host 0.0.0.0 --port 12012 --no-access-log > nohup.out 2>&1 < /dev/null &
- echo "started mainspacy pid=$!"
|