From 35303c7d20114eb0a2d70f3fbb54b1e6576d5d3d Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Wed, 8 Mar 2023 21:38:51 -0600 Subject: [PATCH] feat(api): add a way to pass extra args to the conversion script --- api/launch-extras.bat | 9 ++++++++- api/launch-extras.sh | 3 ++- api/launch.bat | 8 +++++++- api/launch.sh | 3 ++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/api/launch-extras.bat b/api/launch-extras.bat index 126df2c6..5d5ff929 100644 --- a/api/launch-extras.bat +++ b/api/launch-extras.bat @@ -1,6 +1,13 @@ echo "Downloading and converting models to ONNX format..." IF "%ONNX_WEB_EXTRA_MODELS%"=="" (set ONNX_WEB_EXTRA_MODELS=extras.json) -python -m onnx_web.convert --sources --diffusion --upscaling --correction --extras=%ONNX_WEB_EXTRA_MODELS% --token=%HF_TOKEN% +python -m onnx_web.convert ^ +--sources ^ +--diffusion ^ +--upscaling ^ +--correction ^ +--extras=%ONNX_WEB_EXTRA_MODELS% ^ +--token=%HF_TOKEN% ^ +%ONNX_WEB_EXTRA_ARGS% echo "Launching API server..." flask --app="onnx_web.main:run" run --host=0.0.0.0 diff --git a/api/launch-extras.sh b/api/launch-extras.sh index 50572aa4..5912ae87 100755 --- a/api/launch-extras.sh +++ b/api/launch-extras.sh @@ -22,7 +22,8 @@ python3 -m onnx_web.convert \ --upscaling \ --correction \ --extras=${ONNX_WEB_EXTRA_MODELS:-extras.json} \ - --token=${HF_TOKEN:-} + --token=${HF_TOKEN:-} \ + ${ONNX_WEB_EXTRA_ARGS:-} echo "Launching API server..." flask --app='onnx_web.main:run' run --host=0.0.0.0 diff --git a/api/launch.bat b/api/launch.bat index 09ddfccd..725aa0e7 100644 --- a/api/launch.bat +++ b/api/launch.bat @@ -1,5 +1,11 @@ echo "Downloading and converting models to ONNX format..." -python -m onnx_web.convert --sources --diffusion --upscaling --correction --token=%HF_TOKEN% +python -m onnx_web.convert ^ +--sources ^ +--diffusion ^ +--upscaling ^ +--correction ^ +--token=%HF_TOKEN% ^ +%ONNX_WEB_EXTRA_ARGS% echo "Launching API server..." flask --app="onnx_web.main:run" run --host=0.0.0.0 diff --git a/api/launch.sh b/api/launch.sh index 55b6ff72..bca6dfb3 100755 --- a/api/launch.sh +++ b/api/launch.sh @@ -21,7 +21,8 @@ python3 -m onnx_web.convert \ --diffusion \ --upscaling \ --correction \ - --token=${HF_TOKEN:-} + --token=${HF_TOKEN:-} \ + ${ONNX_WEB_EXTRA_ARGS:-} echo "Launching API server..." flask --app='onnx_web.main:run' run --host=0.0.0.0