1
0
Fork 0

fix(api): make venv has been loaded in launch script

This commit is contained in:
Sean Sube 2023-02-09 22:02:27 -06:00
parent 36d164a281
commit d8d5bcd927
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 14 additions and 1 deletions

View File

@ -2,8 +2,21 @@
set -eu 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..." echo "Downloading and converting models to ONNX format..."
python3 -m onnx_web.convert --diffusion --upscaling --correction --extras=./extras.json --token=${HF_TOKEN:-} python3 -m onnx_web.convert --diffusion --upscaling --correction --extras=extras.json --token=${HF_TOKEN:-}
echo "Launching API server..." echo "Launching API server..."
flask --app=onnx_web.serve run --host=0.0.0.0 flask --app=onnx_web.serve run --host=0.0.0.0