-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(api): split up base and extras launch scripts
- Loading branch information
Showing
4 changed files
with
35 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
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% | ||
|
||
echo "Launching API server..." | ||
flask --app=onnx_web.serve run --host=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#! /bin/sh | ||
|
||
set -eu | ||
|
||
if [ -n "${VIRTUAL_ENV+set}" ]; then | ||
echo "Using current virtual env..." | ||
else | ||
if [ -d "onnx_env" ]; then | ||
echo "Loading existing virtual env..." | ||
. onnx_env/bin/activate | ||
else | ||
echo "Creating new virtual env..." | ||
python -m venv onnx_env | ||
. onnx_env/bin/activate | ||
fi | ||
fi | ||
|
||
echo "Downloading and converting models to ONNX format..." | ||
python3 -m onnx_web.convert \ | ||
--sources \ | ||
--diffusion \ | ||
--upscaling \ | ||
--correction \ | ||
--extras=${ONNX_WEB_EXTRA_MODELS:-extras.json} \ | ||
--token=${HF_TOKEN:-} | ||
|
||
echo "Launching API server..." | ||
flask --app=onnx_web.serve run --host=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
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=extras.json --token=%HF_TOKEN% | ||
python -m onnx_web.convert --sources --diffusion --upscaling --correction --token=%HF_TOKEN% | ||
|
||
echo "Launching API server..." | ||
flask --app=onnx_web.serve run --host=0.0.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters