fix(api): make venv has been loaded in launch script
This commit is contained in:
parent
36d164a281
commit
d8d5bcd927
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue