mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-03 04:02:49 +08:00
[docker] patch docker-rocm (#7725)
* Update Dockerfile * Fix typo * Fix syntax for /bin/sh conditional * Add build args to docker-compose * Change shell to /bin/bash This is required for "==" syntax in conditional string comparison
This commit is contained in:
parent
ac8c6fdd3a
commit
b5d667cebf
@ -12,8 +12,13 @@ ARG INSTALL_DEEPSPEED=false
|
|||||||
ARG INSTALL_FLASHATTN=false
|
ARG INSTALL_FLASHATTN=false
|
||||||
ARG INSTALL_LIGER_KERNEL=false
|
ARG INSTALL_LIGER_KERNEL=false
|
||||||
ARG INSTALL_HQQ=false
|
ARG INSTALL_HQQ=false
|
||||||
|
ARG INSTALL_PYTORCH=true
|
||||||
ARG PIP_INDEX=https://pypi.org/simple
|
ARG PIP_INDEX=https://pypi.org/simple
|
||||||
ARG HTTP_PROXY=
|
ARG HTTP_PROXY=
|
||||||
|
ARG PYTORCH_INDEX=https://download.pytorch.org/whl/nightly/rocm6.3
|
||||||
|
|
||||||
|
# Use Bash instead of default /bin/sh
|
||||||
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@ -62,6 +67,13 @@ RUN EXTRA_PACKAGES="metrics"; \
|
|||||||
pip install -e ".[$EXTRA_PACKAGES]"; \
|
pip install -e ".[$EXTRA_PACKAGES]"; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Reinstall pytorch
|
||||||
|
# This is necessary to ensure that the correct version of PyTorch is installed
|
||||||
|
RUN if [ "$INSTALL_PYTORCH" == "true" ]; then \
|
||||||
|
pip uninstall -y torch torchvision torchaudio && \
|
||||||
|
pip install --pre torch torchvision torchaudio --index-url "$PYTORCH_INDEX"; \
|
||||||
|
fi
|
||||||
|
|
||||||
# Rebuild flash attention
|
# Rebuild flash attention
|
||||||
RUN pip uninstall -y transformer-engine flash-attn && \
|
RUN pip uninstall -y transformer-engine flash-attn && \
|
||||||
if [ "$INSTALL_FLASHATTN" == "true" ]; then \
|
if [ "$INSTALL_FLASHATTN" == "true" ]; then \
|
||||||
|
@ -9,8 +9,10 @@ services:
|
|||||||
INSTALL_DEEPSPEED: "false"
|
INSTALL_DEEPSPEED: "false"
|
||||||
INSTALL_FLASHATTN: "false"
|
INSTALL_FLASHATTN: "false"
|
||||||
INSTALL_LIGER_KERNEL: "false"
|
INSTALL_LIGER_KERNEL: "false"
|
||||||
|
INSTALL_PYTORCH: "true"
|
||||||
INSTALL_HQQ: "false"
|
INSTALL_HQQ: "false"
|
||||||
PIP_INDEX: https://pypi.org/simple
|
PIP_INDEX: https://pypi.org/simple
|
||||||
|
PYTORCH_INDEX: https://download.pytorch.org/whl/nightly/rocm6.3
|
||||||
container_name: llamafactory
|
container_name: llamafactory
|
||||||
volumes:
|
volumes:
|
||||||
- ../../hf_cache:/root/.cache/huggingface
|
- ../../hf_cache:/root/.cache/huggingface
|
||||||
|
Loading…
x
Reference in New Issue
Block a user