Files
local-translator/start.bat
T

27 lines
740 B
Batchfile

@echo off
setlocal
cd /d "%~dp0"
if exist ".venv\Scripts\python.exe" goto dependencies
where py >nul 2>nul
if not errorlevel 1 (
py -3 -m venv .venv
) else (
python -m venv .venv
)
if errorlevel 1 goto failed
:dependencies
if exist ".venv\translator-installed" goto run
".venv\Scripts\python.exe" -m pip install -e .
if errorlevel 1 goto failed
type nul > ".venv\translator-installed"
:run
if not exist config.toml copy /y config.example.toml config.toml >nul
echo Local Translator: http://127.0.0.1:8787/docs ^(default port^)
".venv\Scripts\python.exe" -m local_translator --config "%~dp0config.toml"
if errorlevel 1 goto failed
exit /b 0
:failed
echo Startup failed. Python 3.11+ is required. See the error above.
pause
exit /b 1