Spaces:
Sleeping
Sleeping
| # Local testing script for SATINT-Analyst Hugging Face Space | |
| # This uses uv for fast dependency management locally | |
| # Hugging Face will still use requirements.txt when deployed | |
| set -e # Exit on error | |
| echo "π Setting up local testing environment with uv..." | |
| # Check if uv is installed | |
| if ! command -v uv &> /dev/null; then | |
| echo "β uv is not installed. Install it with: pip install uv" | |
| exit 1 | |
| fi | |
| # Create virtual environment if it doesn't exist | |
| if [ ! -d ".venv" ]; then | |
| echo "π¦ Creating virtual environment..." | |
| uv venv | |
| fi | |
| # Activate virtual environment | |
| echo "π Activating virtual environment..." | |
| source .venv/bin/activate | |
| # Install dependencies from requirements.txt using uv (much faster than pip) | |
| echo "π₯ Installing dependencies with uv..." | |
| uv pip install -r requirements.txt | |
| # Run the Gradio app | |
| echo "π― Starting Gradio app..." | |
| echo "π App will be available at http://127.0.0.1:7860" | |
| echo "Press Ctrl+C to stop" | |
| echo "" | |
| python app.py | |