#!/usr/bin/env bash set -euo pipefail /home/user/app/scripts/run_backend.sh & backend_pid=$! cleanup() { kill "${backend_pid}" 2>/dev/null || true } trap cleanup EXIT INT TERM # Expose the UI immediately while the model initializes in the background. exec uvicorn app:app --host 0.0.0.0 --port "${PORT:-7860}" --workers 1