Revert "feat(server): Machine learning's image optimisations (#1908)" (#1915)

This reverts commit 977740045a.
This commit is contained in:
Zack Pollard
2023-03-01 17:48:35 +00:00
committed by GitHub
parent 830f4268c3
commit 1cc184ed10
3 changed files with 10 additions and 79 deletions

View File

@@ -1,26 +1,19 @@
FROM python:3.10 as builder
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=true
COPY requirements.txt ./
RUN python -m venv /opt/venv && \
/opt/venv/bin/pip install --upgrade pip setuptools wheel && \
/opt/venv/bin/pip install --no-deps -r requirements.txt
FROM python:3.10-slim
COPY --from=builder /opt/venv /opt/venv
FROM python:3.10
ENV TRANSFORMERS_CACHE=/cache \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PATH="/opt/venv/bin:$PATH"
PIP_NO_CACHE_DIR=true
WORKDIR /usr/src/app
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --pre torch -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
RUN pip install transformers tqdm numpy scikit-learn scipy nltk sentencepiece flask Pillow
RUN pip install --no-deps sentence-transformers
COPY . .
CMD ["gunicorn", "src.main:server"]
CMD ["python", "src/main.py"]