feat(api): switch to package structure
This commit is contained in:
parent
55d435489a
commit
599e0ee2d0
|
@ -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:
|
In the `api/` directory, run the server with Flask:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
> flask --app serve run
|
> flask --app=onnx_web run
|
||||||
```
|
```
|
||||||
|
|
||||||
Note the IP address this prints.
|
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:
|
If you want to access the server from other machines on your local network, pass the `--host` argument:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
> flask --app serve run --host 0.0.0.0
|
> flask --app=onnx_web run --host=0.0.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
This will listen for requests from your current local network and may be dangerous.
|
This will listen for requests from your current local network and may be dangerous.
|
||||||
|
|
|
@ -11,6 +11,6 @@ COPY requirements.txt /onnx-web/requirements.txt
|
||||||
|
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
COPY serve.py /onnx-web/serve.py
|
COPY onnx_web/ /onnx-web/onnx_web/
|
||||||
|
|
||||||
ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ]
|
ENTRYPOINT [ "flask", "--app=onnx_web", "run", "--host=0.0.0.0" ]
|
||||||
|
|
|
@ -10,6 +10,6 @@ COPY requirements.txt /onnx-web/requirements.txt
|
||||||
|
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
COPY serve.py /onnx-web/serve.py
|
COPY onnx_web/ /onnx-web/onnx_web/
|
||||||
|
|
||||||
ENTRYPOINT [ "flask", "--app=serve", "run", "--host=0.0.0.0" ]
|
ENTRYPOINT [ "flask", "--app=onnx_web", "run", "--host=0.0.0.0" ]
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
[metadata]
|
||||||
|
description-file = README.md
|
|
@ -0,0 +1,25 @@
|
||||||
|
import setuptools
|
||||||
|
|
||||||
|
with open("README.md", "r") as fh:
|
||||||
|
long_description = fh.read()
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
name="onnx_web",
|
||||||
|
version="0.1.0",
|
||||||
|
author="ssube",
|
||||||
|
author_email="seansube@gmail.com",
|
||||||
|
description="web UI for running ONNX models",
|
||||||
|
long_description=long_description,
|
||||||
|
long_description_content_type="text/markdown",
|
||||||
|
url="https://github.com/ssube/onnx-web",
|
||||||
|
keywords=[
|
||||||
|
'onnx',
|
||||||
|
],
|
||||||
|
packages=setuptools.find_packages(),
|
||||||
|
classifiers=[
|
||||||
|
"Programming Language :: Python :: 3",
|
||||||
|
"License :: OSI Approved :: MIT License",
|
||||||
|
"Operating System :: OS Independent",
|
||||||
|
],
|
||||||
|
python_requires='>=3.8,<3.11',
|
||||||
|
)
|
|
@ -25,6 +25,8 @@ vendor/
|
||||||
.codeclimate.yml
|
.codeclimate.yml
|
||||||
.dockerignore
|
.dockerignore
|
||||||
.eslintrc.json
|
.eslintrc.json
|
||||||
|
.mocharc.json
|
||||||
|
.reporters.json
|
||||||
|
|
||||||
Containerfile.*
|
Containerfile.*
|
||||||
Makefile
|
Makefile
|
||||||
|
|
Loading…
Reference in New Issue