File size: 542 Bytes
b4df929
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
FROM python:3.9-slim-buster

ENV PYTHONUNBUFFERED=1 \
    HF_HOME=/app/.cache \
    TORCH_HOME=/app/cache \
    USE_CUDA=false

RUN apt-get update && apt-get install -y --no-install-recommends gcc python3-dev

WORKDIR /app
COPY . .

RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt && \
    python -c "from transformers import pipeline; pipeline('zero-shot-classification', model='joeddav/xlm-roberta-large-xnli')"

CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--threads", "4", "app:app"]