Spaces:
Sleeping
Sleeping
| # MedeX Quick Start Script | |
| # Quick setup and launch for local testing | |
| echo "π₯ MedeX - Quick Start Script" | |
| echo "==============================" | |
| echo "" | |
| # Check if we're in the right directory | |
| if [ ! -f "streamlit_app.py" ]; then | |
| echo "β Error: streamlit_app.py not found" | |
| echo "Please run this script from the MedeX-main directory" | |
| exit 1 | |
| fi | |
| # Check Python version | |
| echo "1οΈβ£ Checking Python version..." | |
| python3 --version || { echo "β Python 3 not found"; exit 1; } | |
| echo "β Python found" | |
| echo "" | |
| # Check if virtual environment exists | |
| if [ ! -d "medex_venv" ]; then | |
| echo "2οΈβ£ Creating virtual environment..." | |
| python3 -m venv medex_venv | |
| echo "β Virtual environment created" | |
| else | |
| echo "2οΈβ£ Virtual environment already exists" | |
| fi | |
| echo "" | |
| # Activate virtual environment | |
| echo "3οΈβ£ Activating virtual environment..." | |
| source medex_venv/bin/activate || { echo "β Failed to activate venv"; exit 1; } | |
| echo "β Virtual environment activated" | |
| echo "" | |
| # Install/Update dependencies | |
| echo "4οΈβ£ Installing dependencies..." | |
| pip install --upgrade pip -q | |
| pip install -r requirements.txt -q | |
| echo "β Dependencies installed" | |
| echo "" | |
| # Run pre-deployment tests | |
| echo "5οΈβ£ Running pre-deployment tests..." | |
| python test_deployment.py | |
| echo "" | |
| # Ask if user wants to continue | |
| read -p "Continue to launch Streamlit? (y/n) " -n 1 -r | |
| echo "" | |
| if [[ ! $REPLY =~ ^[Yy]$ ]]; then | |
| echo "Exiting. Run 'streamlit run streamlit_app.py' when ready." | |
| exit 0 | |
| fi | |
| # Launch Streamlit | |
| echo "6οΈβ£ Launching MedeX Streamlit Interface..." | |
| echo "" | |
| echo "π Opening browser at http://localhost:8501" | |
| echo "β¨οΈ Press Ctrl+C to stop" | |
| echo "" | |
| streamlit run streamlit_app.py | |
| # Cleanup message | |
| echo "" | |
| echo "π MedeX stopped. Goodbye!" | |