|
|
|
FROM python:3.10-slim |
|
|
|
ENV DEBIAN_FRONTEND=noninteractive \ |
|
PYTHONUNBUFFERED=1 \ |
|
PYTHONDONTWRITEBYTECODE=1 |
|
|
|
WORKDIR /code |
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
build-essential \ |
|
git \ |
|
curl \ |
|
libopenblas-dev \ |
|
libomp-dev \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN pip install --no-cache-dir huggingface-hub sentencepiece accelerate sacremoses |
|
|
|
|
|
ENV HF_HOME=/tmp/huggingface \ |
|
TRANSFORMERS_CACHE=/tmp/huggingface \ |
|
HUGGINGFACE_HUB_CACHE=/tmp/huggingface \ |
|
HF_HUB_CACHE=/tmp/huggingface |
|
|
|
|
|
RUN mkdir -p /tmp/huggingface && \ |
|
chmod -R 777 /tmp/huggingface |
|
|
|
|
|
|
|
|
|
COPY . . |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
CMD ["python", "app.py"] |
|
|
|
|