Dexter Edep
Add gradio UI
045edbf
raw
history blame contribute delete
900 Bytes
#!/bin/bash
# Startup script for Gradio UI
# Default port
PORT=${GRADIO_SERVER_PORT:-7860}
# Check if port is in use
if lsof -Pi :$PORT -sTCP:LISTEN -t >/dev/null 2>&1 ; then
echo "⚠️ Port $PORT is already in use!"
echo ""
echo "Options:"
echo " 1. Use a different port: GRADIO_SERVER_PORT=7861 ./run.sh"
echo " 2. Kill the existing process: kill \$(lsof -t -i:$PORT)"
echo ""
# Try to find an available port
for try_port in {7861..7870}; do
if ! lsof -Pi :$try_port -sTCP:LISTEN -t >/dev/null 2>&1 ; then
echo "βœ… Found available port: $try_port"
echo " Starting on port $try_port..."
export GRADIO_SERVER_PORT=$try_port
PORT=$try_port
break
fi
done
fi
echo "πŸš€ Starting Gradio UI on port $PORT..."
echo " Access at: http://localhost:$PORT"
echo ""
python3 app.py