File size: 1,704 Bytes
e4f1d27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5398829
e4f1d27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
@echo off

rem onw - Ore no NPU ga konna ni ugoku wake nai: run the server once from a console (Windows).

rem   start.bat                                   Gemma 4 E4B (default: text + image, fits 16 GB machines)

rem   start.bat ryugyosoft/Qwen3.6-35B-A3B-onw    any onw model: a Hugging Face repo id or a local folder

rem   start.bat MODEL --port 8080                 further options go to "onw serve"

rem First run: finds / installs Python, creates .venv (~1 GB), downloads the model, compiles it for the NPU.

rem For the resident tray app with a model manager use setup.bat instead.
setlocal
cd /d "%~dp0"
set PYTHONUTF8=1
set "MODEL=ryugyosoft/gemma-4-E4B-it-onw"
set "FIRST=%~1"
if not "%FIRST%"=="" if not "%FIRST:~0,1%"=="-" (
    set "MODEL=%FIRST%"
    shift
)

if exist ".venv\installed.txt" goto args
if exist ".venv\Scripts\python.exe" goto install
call "%~dp0find_python.bat"
if not defined PY (
    pause
    exit /b 1
)
echo [setup] creating Python environment in .venv ...
%PY% -m venv .venv
if errorlevel 1 (
    echo [setup] could not create the Python environment.
    pause
    exit /b 1
)
:install
".venv\Scripts\python.exe" -m pip install "pip>=26.2.2"
".venv\Scripts\python.exe" -m pip install -e . --extra-index-url https://storage.openvinotoolkit.org/simple/wheels/pre-release
if errorlevel 1 (
    echo [setup] package installation failed.
    pause
    exit /b 1
)
echo ok> ".venv\installed.txt"

:args
set "ARGS="
:collect
if "%~1"=="" goto run
set "ARGS=%ARGS% %1"
shift
goto collect
:run
echo [start] %MODEL% (first time: download + NPU compile, please wait) ...
".venv\Scripts\onw.exe" serve "%MODEL%" --open %ARGS%
pause