Skip to content

Commit bff672f

Browse files
authored
fix Dockerfiles for cuda and xformers. (#13022)
1 parent d4f97d1 commit bff672f

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

docker/diffusers-pytorch-cuda/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
22
LABEL maintainer="Hugging Face"
33
LABEL repository="diffusers"
44

5-
ARG PYTHON_VERSION=3.12
5+
ARG PYTHON_VERSION=3.11
66
ENV DEBIAN_FRONTEND=noninteractive
77

88
RUN apt-get -y update \
@@ -32,10 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
3232
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3333

3434
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
35+
# Install torch, torchvision, and torchaudio together to ensure compatibility
3536
RUN uv pip install --no-cache-dir \
3637
torch \
3738
torchvision \
38-
torchaudio
39+
torchaudio \
40+
--index-url https://download.pytorch.org/whl/cu121
3941

4042
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
4143

docker/diffusers-pytorch-xformers-cuda/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
22
LABEL maintainer="Hugging Face"
33
LABEL repository="diffusers"
44

5-
ARG PYTHON_VERSION=3.12
5+
ARG PYTHON_VERSION=3.11
66
ENV DEBIAN_FRONTEND=noninteractive
77

88
RUN apt-get -y update \
@@ -32,10 +32,12 @@ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
3232
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3333

3434
# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
35+
# Install torch, torchvision, and torchaudio together to ensure compatibility
3536
RUN uv pip install --no-cache-dir \
3637
torch \
3738
torchvision \
38-
torchaudio
39+
torchaudio \
40+
--index-url https://download.pytorch.org/whl/cu121
3941

4042
RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
4143

0 commit comments

Comments
 (0)