This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
# The DAG object; we'll need this to instantiate a DAG | |
from airflow import DAG | |
# Operators; we need this to operate! | |
from airflow.operators.bash_operator import BashOperator | |
from airflow.utils.dates import days_ago | |
# These args will get passed on to each operator | |
# You can override them on a per-task basis during operator initialization | |
default_args = { | |
'owner': 'Binh Phan', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#required libraries | |
aiohttp==3.6.2 | |
fastai==1.0.61 | |
Pillow==7.1.1 | |
python-multipart==0.0.5 | |
starlette==0.13.3 | |
torch==1.5.0 | |
torchvision==0.6.0 | |
uvicorn==0.11.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.6-slim-stretch | |
RUN apt update | |
RUN apt install -y python3-dev gcc | |
ADD requirements.txt requirements.txt | |
ADD export.pkl export.pkl | |
ADD app.py app.py | |
# Install required libraries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#deep learning libraries | |
from fastai.vision import * | |
import torch | |
defaults.device = torch.device('cpu') | |
#web frameworks | |
from starlette.applications import Starlette | |
from starlette.responses import JSONResponse, HTMLResponse, RedirectResponse | |
import uvicorn | |
import aiohttp |