Skip to content

Commit

Permalink
fix(exe): add build script for Windows bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Apr 30, 2023
1 parent 572a515 commit a76ded2
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
4 changes: 4 additions & 0 deletions exe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build/
dist/

commit.txt
22 changes: 22 additions & 0 deletions exe/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
REM activate venv
..\api\onnx_env\Scripts\Activate.bat

REM build bundle
pyinstaller win10.directml.dir.spec

REM add additional files
xcopy \gfpgan \dist\server\gfpgan /t /e
xcopy ..\api\gui \dist\client /t /e
xcopy ..\api\schemas \dist\schemas /t /e
xcopy ..\api\logging.yaml \dist\logging.yaml
xcopy ..\api\params.json \dist\params.json
xcopy ..\docs \dist\docs /t /e
xcopy ..\models \dist\models /t /e
xcopy ..\outputs \dist\outputs /t /e

REM get commit info
git rev-parse HEAD > commit.txt
set /p GIT_SHA=<commit.txt

REM create archive
7za a ..\dist\onnx-web-v0.10.0-rc-%GIT_SHA%.zip "\dist\*"
2 changes: 1 addition & 1 deletion exe/onnx-web-full.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set ONNX_WEB_OUTPUT_PATH=%ONNX_WEB_BASE_PATH%\outputs

REM customize these as needed
set ONNX_WEB_CACHE_MODELS=0
set ONNX_WEB_EXTRA_MODELS=%ONNX_WEB_BASE_PATH%\models\onnx-web-extras.json
set ONNX_WEB_EXTRA_MODELS=%ONNX_WEB_BASE_PATH%\extras.json

REM convert models and launch the server
@echo Launching onnx-web in fp32 mode...
Expand Down
2 changes: 1 addition & 1 deletion exe/onnx-web-half.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set ONNX_WEB_OUTPUT_PATH=%ONNX_WEB_BASE_PATH%\outputs
REM customize these as needed
set ONNX_WEB_BLOCK_PLATFORMS=cpu
set ONNX_WEB_CACHE_MODELS=0
set ONNX_WEB_EXTRA_MODELS=%ONNX_WEB_BASE_PATH%\models\onnx-web-extras.json
set ONNX_WEB_EXTRA_MODELS=%ONNX_WEB_BASE_PATH%\models\extras.json

REM convert models and launch the server
@echo Launching onnx-web in fp16 mode...
Expand Down

0 comments on commit a76ded2

Please sign in to comment.