feat: browser access (allowed_origins, CORS with Private Network Access), job cancel, Tomie/Unity adapters, benchmark
Includes earlier uncommitted work: Tomie and Unity adapters, benchmark, structured output, call metrics. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
13492929c6
commit
f49ee90477
32 files changed
+2799
-51
No files matched your search
@@ -0,0 +1,32 @@
|
||||
@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
|
||||
".venv\Scripts\python.exe" -c "import UnityPy" >nul 2>nul
|
||||
if not errorlevel 1 goto configured
|
||||
".venv\Scripts\python.exe" -m pip install -e ".[unity]"
|
||||
if errorlevel 1 goto failed
|
||||
:configured
|
||||
if not exist benchmark.json copy /y benchmark.example.json benchmark.json >nul
|
||||
".venv\Scripts\python.exe" -X utf8 -m local_translator.benchmark --config benchmark.json %*
|
||||
if errorlevel 1 goto failed
|
||||
echo Benchmark complete. Results are in data\benchmarks.
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 0
|
||||
:failed
|
||||
echo Benchmark failed. See the error above. Partial results are preserved.
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 1
|
||||
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
setlocal
|
||||
chcp 65001 >nul
|
||||
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
|
||||
".venv\Scripts\python.exe" -c "import local_translator, UnityPy, fontTools" >nul 2>nul
|
||||
if not errorlevel 1 goto run
|
||||
".venv\Scripts\python.exe" -m pip install -e ".[unity]"
|
||||
if errorlevel 1 goto failed
|
||||
:run
|
||||
if not exist tomie.json copy /y tomie.example.json tomie.json >nul
|
||||
".venv\Scripts\python.exe" -X utf8 -m local_translator.tomie --config tomie.json %*
|
||||
if errorlevel 1 goto failed
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 0
|
||||
:failed
|
||||
echo Failed. See the error above.
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 1
|
||||
@@ -0,0 +1,26 @@
|
||||
@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 "config.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
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call "%~dp0..\lib\tomie-common.bat" install %*
|
||||
exit /b %errorlevel%
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call "%~dp0..\lib\tomie-common.bat" prepare %*
|
||||
exit /b %errorlevel%
|
||||
@@ -0,0 +1,3 @@
|
||||
@echo off
|
||||
call "%~dp0..\lib\tomie-common.bat" restore %*
|
||||
exit /b %errorlevel%
|
||||
@@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
setlocal
|
||||
chcp 65001 >nul
|
||||
cd /d "%~dp0..\..\.."
|
||||
if not exist tomie.json copy /y tomie.example.json tomie.json >nul
|
||||
if not exist "data\tomie\patches\latest.json" (
|
||||
echo Run scripts\windows\tomie\prepare_tomie_translation.bat first.
|
||||
goto failed
|
||||
)
|
||||
if not exist ".venv\Scripts\python.exe" (
|
||||
echo Run scripts\windows\tomie\prepare_tomie_translation.bat first.
|
||||
goto failed
|
||||
)
|
||||
".venv\Scripts\python.exe" -c "import TypeTreeGeneratorAPI" >nul 2>nul
|
||||
if errorlevel 1 (
|
||||
".venv\Scripts\python.exe" -m pip install -e ".[unity]"
|
||||
if errorlevel 1 goto failed
|
||||
)
|
||||
".venv\Scripts\python.exe" -X utf8 -m local_translator.tomie_full --config tomie.json run --retry %*
|
||||
if errorlevel 1 goto failed
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 0
|
||||
:failed
|
||||
echo Translation stopped. Progress is saved; run this file again to continue.
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
exit /b 1
|
||||
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
setlocal
|
||||
chcp 65001 >nul
|
||||
cd /d "%~dp0..\..\.."
|
||||
".venv\Scripts\python.exe" -X utf8 -m local_translator.tomie_full --config tomie.json status
|
||||
if not defined LOCAL_TRANSLATOR_NO_PAUSE pause
|
||||
Reference in new issue
Block a user