Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +5 -4
Dockerfile
CHANGED
@@ -26,23 +26,24 @@ RUN git clone --depth 1 --branch ${REPO_BRANCH} https://github.com/BramVanroy/ma
|
|
26 |
WORKDIR $HOME/mateo-demo
|
27 |
|
28 |
ARG USE_CUDA=false
|
|
|
|
|
|
|
29 |
RUN uv venv .venv --python 3.11 \
|
30 |
&& . .venv/bin/activate \
|
31 |
&& uv pip install --no-cache-dir --upgrade pip wheel setuptools \
|
32 |
-
# Conditionally install PyTorch (CPU or CUDA 12.1)
|
33 |
&& if [ "$USE_CUDA" = "true" ]; then \
|
34 |
echo "Installing PyTorch with CUDA 12.1 support"; \
|
35 |
-
uv pip install --no-cache-dir torch==
|
36 |
else \
|
37 |
echo "Installing PyTorch with CPU support"; \
|
38 |
-
uv pip install --no-cache-dir torch==
|
39 |
fi \
|
40 |
&& uv pip install --no-cache-dir --upgrade $HOME/mateo-demo[patch] \
|
41 |
&& uv cache clean
|
42 |
|
43 |
# --- Runtime Configuration ---
|
44 |
# Set runtime environment variables
|
45 |
-
# NOTE: for HF spaces we set XSRF to false
|
46 |
ENV PORT=7860 \
|
47 |
SERVER="localhost" \
|
48 |
BASE="" \
|
|
|
26 |
WORKDIR $HOME/mateo-demo
|
27 |
|
28 |
ARG USE_CUDA=false
|
29 |
+
ARG TORCH_CUDA_VERSION="126"
|
30 |
+
ARG TORCH_VERSION="2.7.0"
|
31 |
+
# Conditionally install PyTorch (CPU or CUDA 12.1)
|
32 |
RUN uv venv .venv --python 3.11 \
|
33 |
&& . .venv/bin/activate \
|
34 |
&& uv pip install --no-cache-dir --upgrade pip wheel setuptools \
|
|
|
35 |
&& if [ "$USE_CUDA" = "true" ]; then \
|
36 |
echo "Installing PyTorch with CUDA 12.1 support"; \
|
37 |
+
uv pip install --no-cache-dir torch=="$TORCH_VERSION" --index-url "https://download.pytorch.org/whl/cu${TORCH_CUDA_VERSION}"; \
|
38 |
else \
|
39 |
echo "Installing PyTorch with CPU support"; \
|
40 |
+
uv pip install --no-cache-dir torch=="${TORCH_VERSION}+cpu" --index-url https://download.pytorch.org/whl/cpu; \
|
41 |
fi \
|
42 |
&& uv pip install --no-cache-dir --upgrade $HOME/mateo-demo[patch] \
|
43 |
&& uv cache clean
|
44 |
|
45 |
# --- Runtime Configuration ---
|
46 |
# Set runtime environment variables
|
|
|
47 |
ENV PORT=7860 \
|
48 |
SERVER="localhost" \
|
49 |
BASE="" \
|