@@ -2,14 +2,16 @@ FROM nvidia/cuda:12.1.0-runtime-ubuntu20.04
22LABEL maintainer="Hugging Face"
33LABEL repository="diffusers"
44
5+ ARG PYTHON_VERSION=3.10
56ENV DEBIAN_FRONTEND=noninteractive
67ENV MINIMUM_SUPPORTED_TORCH_VERSION="2.1.0"
78ENV MINIMUM_SUPPORTED_TORCHVISION_VERSION="0.16.0"
89ENV MINIMUM_SUPPORTED_TORCHAUDIO_VERSION="2.1.0"
910
1011RUN apt-get -y update \
1112 && apt-get install -y software-properties-common \
12- && add-apt-repository ppa:deadsnakes/ppa
13+ && add-apt-repository ppa:deadsnakes/ppa && \
14+ apt-get update
1315
1416RUN apt install -y bash \
1517 build-essential \
@@ -19,35 +21,31 @@ RUN apt install -y bash \
1921 ca-certificates \
2022 libsndfile1-dev \
2123 libgl1 \
22- python3.10 \
23- python3.10-dev \
24+ python3 \
2425 python3-pip \
25- python3.10-venv && \
26- rm -rf /var/lib/apt/lists
26+ && apt-get clean \
27+ && rm -rf /var/lib/apt/lists/*
2728
28- # make sure to use venv
29- RUN python3.10 -m venv /opt/venv
30- ENV PATH="/opt/venv/bin:$PATH"
29+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
30+ ENV PATH="/root/.local/bin:$PATH"
31+ ENV VIRTUAL_ENV="/opt/venv"
32+ ENV UV_PYTHON_INSTALL_DIR=/opt/uv/python
33+ RUN uv venv --python ${PYTHON_VERSION} --seed ${VIRTUAL_ENV}
34+ ENV PATH="$VIRTUAL_ENV/bin:$PATH"
3135
3236# pre-install the heavy dependencies (these can later be overridden by the deps from setup.py)
33- RUN python3.10 -m pip install --no-cache-dir --upgrade pip uv==0.1.11 && \
34- python3.10 -m uv pip install --no-cache-dir \
37+ RUN uv pip install --no-cache-dir \
3538 torch==$MINIMUM_SUPPORTED_TORCH_VERSION \
3639 torchvision==$MINIMUM_SUPPORTED_TORCHVISION_VERSION \
37- torchaudio==$MINIMUM_SUPPORTED_TORCHAUDIO_VERSION \
38- invisible_watermark && \
39- python3.10 -m pip install --no-cache-dir \
40+ torchaudio==$MINIMUM_SUPPORTED_TORCHAUDIO_VERSION
41+
42+ RUN uv pip install --no-cache-dir "git+https://github.com/huggingface/diffusers.git@main#egg=diffusers[test]"
43+
44+ # Extra dependencies
45+ RUN uv pip install --no-cache-dir \
4046 accelerate \
41- datasets \
42- hf-doc-builder \
43- huggingface-hub \
44- hf_transfer \
45- Jinja2 \
46- librosa \
4747 numpy==1.26.4 \
48- scipy \
49- tensorboard \
50- transformers \
48+ pytorch-lightning \
5149 hf_transfer
5250
5351CMD ["/bin/bash" ]
0 commit comments