|
|
@echo off |
|
|
setlocal enableextensions enabledelayedexpansion |
|
|
|
|
|
|
|
|
cd /d "%~dp0" |
|
|
|
|
|
|
|
|
set "VENV_DIR=AICoverGen" |
|
|
set "PYTHON_EXE=%VENV_DIR%\Scripts\python.exe" |
|
|
set "PIP_EXE=%VENV_DIR%\Scripts\pip.exe" |
|
|
|
|
|
|
|
|
call "%VENV_DIR%\Scripts\activate.bat" |
|
|
|
|
|
|
|
|
set "ORT_DISABLE_CUDA=1" |
|
|
|
|
|
|
|
|
set "CUDA_VISIBLE_DEVICES=0" |
|
|
|
|
|
|
|
|
set "PYTHONUTF8=1" |
|
|
|
|
|
|
|
|
|
|
|
if not exist "%PYTHON_EXE%" ( |
|
|
echo [ERROR] Virtual environment not found at %VENV_DIR%.^> |
|
|
echo Expected: %PYTHON_EXE% |
|
|
echo Create one first, or ensure the repo was set up correctly. |
|
|
echo. |
|
|
echo Example to create venv: |
|
|
echo python -m venv AICoverGen |
|
|
exit /b 1 |
|
|
) |
|
|
|
|
|
|
|
|
"%PYTHON_EXE%" -m pip install --upgrade pip --disable-pip-version-check 1>nul 2>nul |
|
|
|
|
|
|
|
|
"%PIP_EXE%" install -r requirements.txt --no-input |
|
|
if errorlevel 1 ( |
|
|
echo [ERROR] Failed installing requirements. |
|
|
exit /b 1 |
|
|
) |
|
|
|
|
|
|
|
|
"%PIP_EXE%" install "gradio==3.50.2" --no-input |
|
|
if errorlevel 1 ( |
|
|
echo [ERROR] Failed installing Gradio. |
|
|
exit /b 1 |
|
|
) |
|
|
|
|
|
|
|
|
where ffmpeg >nul 2>nul |
|
|
if errorlevel 1 ( |
|
|
echo [WARN] ffmpeg not found in PATH. Audio processing may fail. |
|
|
echo Install ffmpeg and add it to PATH: https://ffmpeg.org/download.html |
|
|
) |
|
|
|
|
|
|
|
|
start "" /b cmd /c "timeout /t 3 /nobreak >nul & start http://127.0.0.1:7860" |
|
|
|
|
|
|
|
|
"%PYTHON_EXE%" src\webui.py %* |
|
|
|
|
|
|
|
|
set "EXIT_CODE=%ERRORLEVEL%" |
|
|
echo. |
|
|
echo Server exited with code %EXIT_CODE%. |
|
|
exit /b %EXIT_CODE% |
|
|
|