Spaces:
Runtime error
Runtime error
# Exit on error | |
set -e | |
# Kill any existing processes using port 7862 | |
echo "Cleaning up port 7862..." | |
lsof -ti:7862 | xargs kill -9 2>/dev/null || true | |
# Check if uv is installed, if not install it | |
if ! command -v uv &> /dev/null; then | |
echo "Installing uv package installer..." | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
fi | |
# Create virtual environment if it doesn't exist | |
if [ ! -d "venv" ]; then | |
echo "Creating virtual environment..." | |
python -m venv venv | |
fi | |
# Activate virtual environment | |
echo "Activating virtual environment..." | |
source venv/bin/activate | |
# Install dependencies using uv | |
echo "Installing dependencies with uv..." | |
uv pip install -r requirements.txt | |
# Start the Gradio app | |
echo "Starting Gradio app..." | |
python app.py | |
# Deactivate virtual environment when done | |
deactivate |