docker: install xformers with sepcific cuda version, matching the docker image. (#4670)

This commit is contained in:
drew9781 2023-11-19 18:43:15 -06:00 committed by GitHub
parent f0d66cf817
commit 5e70263e25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,7 +12,7 @@ RUN --mount=type=cache,target=/root/.cache/pip,rw \
python3 -m venv /build/venv && \ python3 -m venv /build/venv && \
. /build/venv/bin/activate && \ . /build/venv/bin/activate && \
pip3 install --upgrade pip setuptools wheel ninja && \ pip3 install --upgrade pip setuptools wheel ninja && \
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 && \ pip3 install torch torchvision torchaudio xformers --index-url https://download.pytorch.org/whl/cu121 && \
pip3 install -r requirements.txt pip3 install -r requirements.txt
# https://developer.nvidia.com/cuda-gpus # https://developer.nvidia.com/cuda-gpus
@ -44,8 +44,8 @@ RUN virtualenv /app/venv
RUN --mount=type=cache,target=/root/.cache/pip,rw \ RUN --mount=type=cache,target=/root/.cache/pip,rw \
. /app/venv/bin/activate && \ . /app/venv/bin/activate && \
pip3 install --upgrade pip setuptools wheel ninja && \ pip3 install --upgrade pip setuptools wheel ninja && \
pip3 install torch --index-url https://download.pytorch.org/whl/cu121 && \ pip3 install torch xformers --index-url https://download.pytorch.org/whl/cu121 && \
pip3 install torchvision torchaudio sentence_transformers xformers pip3 install torchvision torchaudio sentence_transformers
# Copy and install GPTQ-for-LLaMa # Copy and install GPTQ-for-LLaMa
COPY --from=builder /build /app/repositories/GPTQ-for-LLaMa COPY --from=builder /build /app/repositories/GPTQ-for-LLaMa