meg HF Staff commited on
Commit
1a4e767
·
verified ·
1 Parent(s): a920b72

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile CHANGED
@@ -8,6 +8,25 @@ ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
  WORKDIR /app
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  COPY --chown=user ./requirements.txt requirements.txt
12
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
13
 
 
8
 
9
  WORKDIR /app
10
 
11
+ ARG PYTORCH_VERSION=2.1.0
12
+ ARG PYTHON_VERSION=3.8.10
13
+ ARG CUDA_VERSION=11.8
14
+ ARG CU_DNN=8.5.0.96
15
+ ARG CUDA_CHANNEL=nvidia
16
+ ARG INSTALL_CHANNEL=pytorch
17
+ # Automatically set by buildx
18
+ ARG TARGETPLATFORM
19
+
20
+
21
+ # Install pytorch
22
+ # On arm64 we exit with an error code
23
+ RUN case ${TARGETPLATFORM} in \
24
+ "linux/arm64") exit 1 ;; \
25
+ *) /opt/conda/bin/conda update -y conda && \
26
+ /opt/conda/bin/conda install -c "${INSTALL_CHANNEL}" -c "${CUDA_CHANNEL}" -y "python=${PYTHON_VERSION}" "pytorch=$PYTORCH_VERSION" "pytorch-cuda=$(echo $CUDA_VERSION | cut -d'.' -f 1-2)" ;; \
27
+ esac && \
28
+ /opt/conda/bin/conda clean -ya
29
+
30
  COPY --chown=user ./requirements.txt requirements.txt
31
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
32