-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_standalone.bat
More file actions
66 lines (52 loc) · 1.81 KB
/
Copy pathrun_standalone.bat
File metadata and controls
66 lines (52 loc) · 1.81 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
@echo off
REM run_standalone.bat - Windows version of the standalone runner
echo =====================================================
echo AI Avatar Video - Standalone Mode (Windows)
echo =====================================================
set PORT=8084
if not "%1"=="" set PORT=%1
REM Check if Python is installed
where python >nul 2>nul
if %ERRORLEVEL% neq 0 (
echo Python is not installed or not in PATH. Please install Python 3.8 or higher.
exit /b 1
)
REM Check if virtual environment exists
if not exist venv (
echo Setting up Python virtual environment...
python -m venv venv
)
REM Activate virtual environment
call venv\Scripts\activate
REM Install dependencies
echo Checking and installing dependencies...
pip install -q -r requirements.txt
REM Initialize database if needed
if not exist app.db (
echo Initializing database...
python init_db.py
)
REM Make sure storage directories exist
if not exist app\storage\characters mkdir app\storage\characters
if not exist app\storage\renders mkdir app\storage\renders
if not exist app\storage\thumbs mkdir app\storage\thumbs
REM Kill any existing server on the same port (Windows version)
for /f "tokens=5" %%a in ('netstat -ano ^| findstr :%PORT%') do (
taskkill /F /PID %%a >nul 2>nul
)
REM Start the application
echo Starting application...
start /B python -m uvicorn app.main:app --host 127.0.0.1 --port %PORT%
REM Wait for the server to start
echo Waiting for application to start...
timeout /t 5 /nobreak >nul
REM Open browser
echo Opening browser...
start http://localhost:%PORT%/
echo.
echo =====================================================
echo AI Avatar Video is running at: http://localhost:%PORT%/
echo Close this window to stop the application
echo =====================================================
REM Keep the window open
pause > nul