Skip to content

Commit

Permalink
feat(api): switch to package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 6, 2023
1 parent 55d4354 commit 599e0ee
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -216,15 +216,15 @@ 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 serve run
> flask --app=onnx_web run
```

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 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.
Expand Down
4 changes: 2 additions & 2 deletions api/Containerfile.alpine
Expand Up @@ -11,6 +11,6 @@ COPY requirements.txt /onnx-web/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" ]
4 changes: 2 additions & 2 deletions api/Containerfile.buster
Expand Up @@ -10,6 +10,6 @@ COPY requirements.txt /onnx-web/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" ]
File renamed without changes.
2 changes: 2 additions & 0 deletions api/setup.cfg
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
25 changes: 25 additions & 0 deletions api/setup.py
@@ -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',
)
2 changes: 2 additions & 0 deletions gui/.npmignore
Expand Up @@ -25,6 +25,8 @@ vendor/
.codeclimate.yml
.dockerignore
.eslintrc.json
.mocharc.json
.reporters.json

Containerfile.*
Makefile
Expand Down

0 comments on commit 599e0ee

Please sign in to comment.