|
|
|
FROM python:3.10-slim |
|
|
|
|
|
RUN apt-get update && apt-get install -y gcc g++ make git |
|
|
|
|
|
WORKDIR /app |
|
RUN mkdir -p /app/.cache /tmp/.triton /tmp/torchinductor_cache && chmod -R 777 /app/.cache /tmp/.triton /tmp/torchinductor_cache |
|
|
|
|
|
ENV HF_HOME=/app/.cache \ |
|
HF_DATASETS_CACHE=/app/.cache \ |
|
HF_HUB_CACHE=/app/.cache \ |
|
TRITON_CACHE_DIR=/tmp/.triton \ |
|
TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_cache |
|
|
|
|
|
RUN pip install --upgrade pip |
|
|
|
|
|
RUN pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 --index-url https://download.pytorch.org/whl/cu118 |
|
|
|
|
|
COPY requirements.txt . |
|
RUN pip install -r requirements.txt |
|
|
|
|
|
COPY app.py . |
|
|
|
|
|
CMD ["python", "app.py"] |
|
|