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
#!/usr/local/bin/python3 | |
import logging, sys, os | |
logging.basicConfig(stream=sys.stdout, | |
format='%(asctime)s : %(levelname)s : %(message)s', | |
level=logging.INFO) | |
import torch | |
import torch.nn.functional as F | |
from pytorch_transformers import BertTokenizer | |
from utils import TransformerWithClfHead | |
from types import SimpleNamespace |
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
# Install training requirements | |
COPY docker-res/requirements.txt "/tmp/" | |
RUN pip install -r "tmp/requirements.txt" | |
# Install app requirements | |
RUN pip install --upgrade uvicorn fastapi |
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
# Set up paths | |
ENV RESOURCES_PATH="/resources" \ | |
DATA_PATH="/data" \ | |
LOG_PATH="/logs" | |
RUN \ | |
mkdir -p $RESOURCES_PATH && \ | |
mkdir -p $DATA_PATH && \ | |
chmod -R a+rwx $DATA_PATH |
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 nvidia/cuda:10.0-cudnn7-devel-ubuntu18.04 | |
WORKDIR /srv | |
RUN chmod 777 /tmp | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential \ | |
python3.7 python3.7-dev python3-virtualenv | |
OlderNewer