feat(api): switch API server to Waitress (#159)
This commit is contained in:
parent
e3540ac435
commit
76860f649a
|
@ -9,4 +9,10 @@ python -m onnx_web.convert ^
|
|||
--token=%HF_TOKEN% %ONNX_WEB_EXTRA_ARGS%
|
||||
|
||||
echo "Launching API server..."
|
||||
flask --app="onnx_web.main:run" run --host=0.0.0.0
|
||||
waitress-serve ^
|
||||
--host=0.0.0.0 ^
|
||||
--port=5000 ^
|
||||
--call ^
|
||||
onnx_web.main:run
|
||||
|
||||
pause
|
||||
|
|
|
@ -26,4 +26,8 @@ python3 -m onnx_web.convert \
|
|||
${ONNX_WEB_EXTRA_ARGS:-}
|
||||
|
||||
echo "Launching API server..."
|
||||
flask --app='onnx_web.main:run' run --host=0.0.0.0
|
||||
waitress-serve \
|
||||
--host=0.0.0.0 \
|
||||
--port=5000 \
|
||||
--call \
|
||||
onnx_web.main:run
|
||||
|
|
|
@ -7,4 +7,10 @@ python -m onnx_web.convert ^
|
|||
--token=%HF_TOKEN% %ONNX_WEB_EXTRA_ARGS%
|
||||
|
||||
echo "Launching API server..."
|
||||
flask --app="onnx_web.main:run" run --host=0.0.0.0
|
||||
waitress-serve ^
|
||||
--host=0.0.0.0 ^
|
||||
--port=5000 ^
|
||||
--call ^
|
||||
onnx_web.main:run
|
||||
|
||||
pause
|
||||
|
|
|
@ -25,4 +25,8 @@ python3 -m onnx_web.convert \
|
|||
${ONNX_WEB_EXTRA_ARGS:-}
|
||||
|
||||
echo "Launching API server..."
|
||||
flask --app='onnx_web.main:run' run --host=0.0.0.0
|
||||
waitress-serve \
|
||||
--host=0.0.0.0 \
|
||||
--port=5000 \
|
||||
--call \
|
||||
onnx_web.main:run
|
||||
|
|
|
@ -78,7 +78,9 @@ def run():
|
|||
|
||||
if __name__ == "__main__":
|
||||
app, pool = main()
|
||||
logger.info("starting image workers")
|
||||
pool.start()
|
||||
logger.info("starting API server")
|
||||
app.run("0.0.0.0", 5000, debug=is_debug())
|
||||
logger.info("shutting down app")
|
||||
logger.info("shutting down workers")
|
||||
pool.join()
|
||||
|
|
|
@ -25,4 +25,5 @@ flask
|
|||
flask-cors
|
||||
jsonschema
|
||||
pyyaml
|
||||
setproctitle
|
||||
setproctitle
|
||||
waitress
|
Loading…
Reference in New Issue