graykode

(add) dockerfile for cuda and cpu

1 +FROM nvcr.io/nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04
2 +LABEL maintainer="nlkey2022@gmail.com"
3 +
4 +RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update \
5 + && DEBIAN_FRONTEND=noninteractive apt-get -qqy install curl python3-pip git \
6 + && rm -rf /var/lib/apt/lists/*
7 +
8 +ARG PYTORCH_WHEEL="https://download.pytorch.org/whl/cu101/torch-1.6.0%2Bcu101-cp36-cp36m-linux_x86_64.whl"
9 +ARG ADDED_MODEL="1YrkwfM-0VBCJaa9NYaXUQPODdGPsmQY4"
10 +ARG DIFF_MODEL="1--gcVVix92_Fp75A-mWH0pJS0ahlni5m"
11 +
12 +RUN git clone https://github.com/graykode/commit-autosuggestions.git /app/commit-autosuggestions \
13 + && cd /app/commit-autosuggestions && python3 setup.py install
14 +
15 +WORKDIR /app/commit-autosuggestions
16 +
17 +RUN pip3 install ${PYTORCH_WHEEL} gdown
18 +RUN gdown https://drive.google.com/uc?id=${ADDED_MODEL} -O weight/added/
19 +RUN gdown https://drive.google.com/uc?id=${DIFF_MODEL} -O weight/diff/
20 +
21 +RUN pip3 install -r requirements.txt
22 +
23 +ENTRYPOINT ["python3", "app.py"]