diff --git a/README.md b/README.md index 6ea7e685..b592f83b 100644 --- a/README.md +++ b/README.md @@ -216,7 +216,7 @@ create them, if you are using the default settings. You can customize the paths In the `api/` directory, run the server with Flask: ```shell -> flask --app=onnx_web run +> flask --app=onnx_web.serve run ``` Note the IP address this prints. @@ -224,7 +224,7 @@ Note the IP address this prints. If you want to access the server from other machines on your local network, pass the `--host` argument: ```shell -> flask --app=onnx_web run --host=0.0.0.0 +> flask --app=onnx_web.serve run --host=0.0.0.0 ``` This will listen for requests from your current local network and may be dangerous. diff --git a/api/.gitignore b/api/.gitignore index bb7f2478..a315070e 100644 --- a/api/.gitignore +++ b/api/.gitignore @@ -1,7 +1,14 @@ .coverage coverage.xml +*.swp +*.pyc + __pycache__/ +dist/ htmlcov/ onnx_env/ -venv/ \ No newline at end of file +venv/ + +*.egg-info/ +**/__pycache__/ diff --git a/api/Containerfile.alpine b/api/Containerfile.alpine index 84ca4ce6..a7ae0505 100644 --- a/api/Containerfile.alpine +++ b/api/Containerfile.alpine @@ -13,4 +13,4 @@ RUN pip install -r requirements.txt COPY onnx_web/ /onnx-web/onnx_web/ -ENTRYPOINT [ "flask", "--app=onnx_web", "run", "--host=0.0.0.0" ] +ENTRYPOINT [ "flask", "--app=onnx_web.serve", "run", "--host=0.0.0.0" ] diff --git a/api/Containerfile.buster b/api/Containerfile.buster index 36446ec7..5932ee92 100644 --- a/api/Containerfile.buster +++ b/api/Containerfile.buster @@ -12,4 +12,4 @@ RUN pip install -r requirements.txt COPY onnx_web/ /onnx-web/onnx_web/ -ENTRYPOINT [ "flask", "--app=onnx_web", "run", "--host=0.0.0.0" ] +ENTRYPOINT [ "flask", "--app=onnx_web.serve", "run", "--host=0.0.0.0" ] diff --git a/api/Makefile b/api/Makefile index 8d66e437..705023a6 100644 --- a/api/Makefile +++ b/api/Makefile @@ -19,7 +19,7 @@ test: package: package-dist package-upload package-dist: - python ./setup.py sdist + python3 ./setup.py sdist package-upload: twine upload dist/* diff --git a/api/README.md b/api/README.md new file mode 100644 index 00000000..e69de29b diff --git a/api/onnx_web/__init__.py b/api/onnx_web/__init__.py new file mode 100644 index 00000000..0a2425f9 --- /dev/null +++ b/api/onnx_web/__init__.py @@ -0,0 +1 @@ +from onnx_web.serve import get_and_clamp, get_from_map, get_latents_from_seed, load_pipeline \ No newline at end of file diff --git a/gui/README.md b/gui/README.md new file mode 100644 index 00000000..e69de29b