|
|
@echo off |
|
|
echo ======================================== |
|
|
echo Starting FastAPI Server |
|
|
echo ======================================== |
|
|
echo. |
|
|
|
|
|
|
|
|
python --version >nul 2>&1 |
|
|
if errorlevel 1 ( |
|
|
echo ERROR: Python is not installed or not in PATH |
|
|
echo Please run: install_requirements.bat first |
|
|
pause |
|
|
exit /b 1 |
|
|
) |
|
|
|
|
|
|
|
|
if not exist "..\models\model_pipeline_improved.joblib" ( |
|
|
if not exist "..\models\model_pipeline.joblib" ( |
|
|
echo WARNING: Model file not found! |
|
|
echo Please ensure model file exists in ../models/ directory |
|
|
echo. |
|
|
) |
|
|
) |
|
|
|
|
|
echo Starting server at http://localhost:8000 |
|
|
echo. |
|
|
echo Available endpoints: |
|
|
echo - HTML Test Interface: Open index.html in browser |
|
|
echo - API Documentation: http://localhost:8000/docs |
|
|
echo - Health Check: http://localhost:8000/health |
|
|
echo. |
|
|
echo Press Ctrl+C to stop the server |
|
|
echo ======================================== |
|
|
echo. |
|
|
|
|
|
|
|
|
python main.py |
|
|
|
|
|
if errorlevel 1 ( |
|
|
echo. |
|
|
echo ERROR: Server failed to start |
|
|
echo Please check the error messages above |
|
|
echo. |
|
|
echo Common issues: |
|
|
echo 1. Port 8000 is already in use |
|
|
echo 2. Missing dependencies (run: install_requirements.bat) |
|
|
echo 3. Model file not found |
|
|
pause |
|
|
exit /b 1 |
|
|
) |
|
|
|