-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
67 lines (57 loc) · 1.68 KB
/
Copy pathrun.bat
File metadata and controls
67 lines (57 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@echo off
REM ================================================
REM Doctane - OCR Development Environment Launcher
REM ================================================
echo.
echo ========================================
echo DOCTANE - Document Analysis System
echo ========================================
echo.
REM Check Python installation
python --version >nul 2>&1
if errorlevel 1 (
echo [ERROR] Python not found. Please install Python 3.8+ from python.org
pause
exit /b 1
)
echo [INFO] Python detected
REM Create virtual environment if not exists
if not exist "venv" (
echo [1/5] Creating virtual environment...
python -m venv venv
if errorlevel 1 (
echo [ERROR] Failed to create virtual environment
pause
exit /b 1
)
)
REM Activate virtual environment
echo [2/5] Activating virtual environment...
call venv\Scripts\activate.bat
REM Install dependencies
echo [3/5] Installing dependencies...
pip install --upgrade pip -q 2>nul
pip install -q fastapi uvicorn python-multipart 2>nul
pip install -q -r requirements.txt 2>nul
pip install -q -e . 2>nul
if errorlevel 1 (
echo [WARNING] Some dependencies may have failed. Continuing...
)
REM Check and create necessary directories
if not exist "data" mkdir data
if not exist "checkpoints" mkdir checkpoints
if not exist "logs" mkdir logs
REM Start API server
echo [4/5] Starting API server...
echo.
echo Services will be available at:
echo - API Server: http://localhost:8000
echo - API Docs: http://localhost:8000/docs
echo - Web Interface: http://localhost:8000/app
echo.
echo Press Ctrl+C to stop the server
echo.
REM Start the server
python api\main.py
REM Deactivate on exit
deactivate