bertweet-large / Dockerfile
modelling-giants's picture
Update Dockerfile
3feb4af verified
Raw
History Blame Contribute Delete
704 Bytes
FROM python:3.11-slim
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY . .
ENV OMP_NUM_THREADS=1
ENV TOKENIZERS_PARALLELISM=false
EXPOSE 7860
# --timeout 120: bertweet-large is slow to load/infer on free CPU. The default
# gunicorn worker timeout (30s) can kill the worker during a cold start or a
# large review batch, which surfaces to the caller as a failed request (and to
# the leaderboard as a null). 120s gives the model room to load and respond.
# CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "120", "app:app"]
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--workers", "1", "--timeout", "120", "app:app"]