mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-02 11:42: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_LIGER_KERNEL=false
|
||||
ARG INSTALL_HQQ=false
|
||||
ARG INSTALL_PYTORCH=true
|
||||
ARG PIP_INDEX=https://pypi.org/simple
|
||||
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
|
||||
WORKDIR /app
|
||||
@ -62,6 +67,13 @@ RUN EXTRA_PACKAGES="metrics"; \
|
||||
pip install -e ".[$EXTRA_PACKAGES]"; \
|
||||
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
|
||||
RUN pip uninstall -y transformer-engine flash-attn && \
|
||||
if [ "$INSTALL_FLASHATTN" == "true" ]; then \
|
||||
|
@ -9,8 +9,10 @@ services:
|
||||
INSTALL_DEEPSPEED: "false"
|
||||
INSTALL_FLASHATTN: "false"
|
||||
INSTALL_LIGER_KERNEL: "false"
|
||||
INSTALL_PYTORCH: "true"
|
||||
INSTALL_HQQ: "false"
|
||||
PIP_INDEX: https://pypi.org/simple
|
||||
PYTORCH_INDEX: https://download.pytorch.org/whl/nightly/rocm6.3
|
||||
container_name: llamafactory
|
||||
volumes:
|
||||
- ../../hf_cache:/root/.cache/huggingface
|
||||
|
Loading…
x
Reference in New Issue
Block a user