File size: 631 Bytes
af18939
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.7-slim-buster

ENV REMOTEPORT 1091
RUN pip install --upgrade pip

RUN   useradd --create-home server

USER server

ENV PATH="/home/server/.local/bin:${PATH}"

COPY --chown=server:server src src

RUN pip install --user -r src/requirements.txt

## Downloading Belgian GPT2 Model, in order to accelerate startup time
RUN python -c "from transformers import GPT2Tokenizer; _ = GPT2Tokenizer.from_pretrained('antoiloui/belgpt2')"
RUN python -c "from transformers import GPT2LMHeadModel; _ = GPT2LMHeadModel.from_pretrained('antoiloui/belgpt2')"

## Running streamlit
CMD streamlit run src/app.py --server.port $REMOTEPORT