File size: 472 Bytes
660263c c9dcc3b 660263c c9dcc3b 660263c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #!/usr/bin/env sh
set -eu
# HF Spaces usually sets PORT=7860, but we default it anyway.
PORT="${PORT:-7860}"
# Auto-detect app dir.
APP_DIR="/app"
if [ -d "/app/src/triage_llm" ]; then
APP_DIR="/app/src"
elif [ -d "/app/triage_llm" ]; then
APP_DIR="/app"
fi
# Use --app-dir so imports like triage_llm.* resolve.
exec uvicorn triage_llm.api.app:app \
--app-dir "${APP_DIR}" \
--host 0.0.0.0 \
--port "${PORT}" \
--proxy-headers \
--forwarded-allow-ips '*'
|