Skip to content

Commit 2bf95a3

Browse files
committed
init
0 parents  commit 2bf95a3

File tree

20 files changed

+688
-0
lines changed

20 files changed

+688
-0
lines changed

.github/workflows/integ-test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Run Tests
2+
3+
on:
4+
# pull_request:
5+
workflow_dispatch:
6+
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up Python 3.6
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.6
17+
- name: Install Python dependencies
18+
run: pip install -e .[test,dev]
19+
- name: Run Integration Tests
20+
env:
21+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
22+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
AWS_DEFAULT_REGION: us-east-1
24+
run: make integ-test

.github/workflows/quality.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Quality Check
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
quality:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python 3.6
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.6
14+
- name: Install Python dependencies
15+
run: pip install -e .[quality]
16+
- name: Run Quality check
17+
run: make quality

.github/workflows/unit-test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Run Unit-Tests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python 3.6
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.6
14+
- name: Install Python dependencies
15+
run: pip install -e .[test,dev]
16+
- name: Run Unit Tests
17+
run: make unit-test
18+
# - name: Run Integration Tests
19+
# run: make integ-test

.gitignore

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
tests
2+
# Docker project generated files to ignore
3+
# if you want to ignore files created by your editor/tools,
4+
# please consider a global .gitignore https://help.github.com/articles/ignoring-files
5+
.vagrant*
6+
bin
7+
docker/docker
8+
.*.swp
9+
a.out
10+
*.orig
11+
build_src
12+
.flymake*
13+
.idea
14+
.DS_Store
15+
docs/_build
16+
docs/_static
17+
docs/_templates
18+
.gopath/
19+
.dotcloud
20+
*.test
21+
bundles/
22+
.hg/
23+
.git/
24+
vendor/pkg/
25+
pyenv
26+
Vagrantfile
27+
# Byte-compiled / optimized / DLL files
28+
__pycache__/
29+
*.py[cod]
30+
*$py.class
31+
32+
# C extensions
33+
*.so
34+
35+
# Distribution / packaging
36+
.Python
37+
build/
38+
develop-eggs/
39+
dist/
40+
downloads/
41+
eggs/
42+
.eggs/
43+
lib/
44+
lib64/
45+
parts/
46+
sdist/
47+
var/
48+
wheels/
49+
share/python-wheels/
50+
*.egg-info/
51+
.installed.cfg
52+
*.egg
53+
MANIFEST
54+
55+
# PyInstaller
56+
# Usually these files are written by a python script from a template
57+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
58+
*.manifest
59+
*.spec
60+
61+
# Installer logs
62+
pip-log.txt
63+
pip-delete-this-directory.txt
64+
65+
# Unit test / coverage reports
66+
htmlcov/
67+
.tox/
68+
.nox/
69+
.coverage
70+
.coverage.*
71+
.cache
72+
nosetests.xml
73+
coverage.xml
74+
*.cover
75+
*.py,cover
76+
.hypothesis/
77+
.pytest_cache/
78+
cover/
79+
80+
# Translations
81+
*.mo
82+
*.pot
83+
84+
# Django stuff:
85+
*.log
86+
local_settings.py
87+
db.sqlite3
88+
db.sqlite3-journal
89+
90+
# Flask stuff:
91+
instance/
92+
.webassets-cache
93+
94+
# Scrapy stuff:
95+
.scrapy
96+
97+
# Sphinx documentation
98+
docs/_build/
99+
100+
# PyBuilder
101+
.pybuilder/
102+
target/
103+
104+
# Jupyter Notebook
105+
.ipynb_checkpoints
106+
107+
# IPython
108+
profile_default/
109+
ipython_config.py
110+
111+
# pyenv
112+
# For a library or package, you might want to ignore these files since the code is
113+
# intended to run in multiple environments; otherwise, check them in:
114+
# .python-version
115+
116+
# pipenv
117+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
118+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
119+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
120+
# install all needed dependencies.
121+
#Pipfile.lock
122+
123+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
124+
__pypackages__/
125+
126+
# Celery stuff
127+
celerybeat-schedule
128+
celerybeat.pid
129+
130+
# SageMath parsed files
131+
*.sage.py
132+
133+
# Environments
134+
.env
135+
.venv
136+
env/
137+
venv/
138+
ENV/
139+
env.bak/
140+
venv.bak/
141+
142+
# Spyder project settings
143+
.spyderproject
144+
.spyproject
145+
146+
# Rope project settings
147+
.ropeproject
148+
149+
# mkdocs documentation
150+
/site
151+
152+
# mypy
153+
.mypy_cache/
154+
.dmypy.json
155+
dmypy.json
156+
157+
# Pyre type checker
158+
.pyre/
159+
160+
# pytype static type analyzer
161+
.pytype/
162+
163+
# Cython debug symbols
164+
cython_debug/
165+
166+
.vscode/settings.json
167+
.sagemaker
168+
model
169+
tests/tmp

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
include LICENSE
3+
include README.md
4+
5+
recursive-exclude * __pycache__
6+
recursive-exclude * *.py[co]

dockerfiles/Dockerfile.cpu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM public.ecr.aws/t6m7g5n4/transformers-inference:4.20.1-pt1.11-cpu
2+
3+
# install robyn framework
4+
RUN pip install robyn
5+
6+
# copy application
7+
COPY app/ .
8+
9+
# run app
10+
CMD ["app.py"]

dockerfiles/Dockerfile.gpu

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM public.ecr.aws/t6m7g5n4/transformers-inference:4.20.1-pt1.11-cuda11.5
2+
3+
# install robyn framework
4+
RUN pip install robyn
5+
6+
# copy application
7+
COPY app/ .
8+
9+
# run app
10+
CMD ["app.py"]

makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.PHONY: quality style unit-test integ-test
2+
3+
check_dirs := src tests
4+
5+
# run tests
6+
7+
unit-test:
8+
python -m pytest -n auto --dist loadfile -s -v ./tests/unit/
9+
10+
integ-test:
11+
python -m pytest -n 2 -s -v ./tests/integ/
12+
# python -m pytest -n auto -s -v ./tests/integ/
13+
14+
15+
# Check that source code meets quality standards
16+
17+
quality:
18+
black --check --line-length 119 --target-version py36 $(check_dirs)
19+
isort --check-only $(check_dirs)
20+
flake8 $(check_dirs)
21+
22+
# Format source code automatically
23+
24+
style:
25+
black --line-length 119 --target-version py36 $(check_dirs)
26+
isort $(check_dirs)

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.black]
2+
line-length = 119
3+
target-version = ['py39']

setup.cfg

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[isort]
2+
default_section = FIRSTPARTY
3+
ensure_newline_before_comments = True
4+
force_grid_wrap = 0
5+
include_trailing_comma = True
6+
known_first_party = huggingface_inference_toolkit
7+
known_third_party =
8+
transformers
9+
huggingface_hub
10+
datasets
11+
tensorflow
12+
torch
13+
robyn
14+
15+
16+
line_length = 119
17+
lines_after_imports = 2
18+
multi_line_output = 3
19+
use_parentheses = True
20+
21+
[flake8]
22+
ignore = E203, E501, E741, W503, W605
23+
max-line-length = 119

0 commit comments

Comments
 (0)