Merge pull request #4561 from hashstone/fix-docker-npu
fix torch-npu dependency
This commit is contained in:
commit
a6bf74c0c9
|
@ -7,26 +7,27 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||||
# Define installation arguments
|
# Define installation arguments
|
||||||
ARG INSTALL_DEEPSPEED=false
|
ARG INSTALL_DEEPSPEED=false
|
||||||
ARG PIP_INDEX=https://pypi.org/simple
|
ARG PIP_INDEX=https://pypi.org/simple
|
||||||
|
ARG TORCH_INDEX=https://download.pytorch.org/whl/cpu
|
||||||
|
|
||||||
# Set the working directory
|
# Set the working directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install the requirements
|
# Install the requirements
|
||||||
COPY requirements.txt /app
|
COPY requirements.txt /app
|
||||||
RUN pip config set global.index-url $PIP_INDEX
|
RUN pip config set global.index-url "$PIP_INDEX" && \
|
||||||
RUN pip config set global.extra-index-url $PIP_INDEX
|
pip config set global.extra-index-url "$TORCH_INDEX" && \
|
||||||
RUN python -m pip install --upgrade pip
|
python -m pip install --upgrade pip && \
|
||||||
RUN python -m pip install -r requirements.txt
|
python -m pip install -r requirements.txt
|
||||||
|
|
||||||
# Copy the rest of the application into the image
|
# Copy the rest of the application into the image
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install the LLaMA Factory
|
# Install the LLaMA Factory
|
||||||
RUN EXTRA_PACKAGES="torch-npu,metrics"; \
|
RUN EXTRA_PACKAGES="torch-npu,metrics"; \
|
||||||
if [ "$INSTALL_DEEPSPEED" = "true" ]; then \
|
if [ "$INSTALL_DEEPSPEED" == "true" ]; then \
|
||||||
EXTRA_PACKAGES="${EXTRA_PACKAGES},deepspeed"; \
|
EXTRA_PACKAGES="${EXTRA_PACKAGES},deepspeed"; \
|
||||||
fi; \
|
fi; \
|
||||||
pip install -e .[$EXTRA_PACKAGES] && \
|
pip install -e ".[$EXTRA_PACKAGES]" && \
|
||||||
pip uninstall -y transformer-engine flash-attn
|
pip uninstall -y transformer-engine flash-attn
|
||||||
|
|
||||||
# Set up volumes
|
# Set up volumes
|
||||||
|
|
Loading…
Reference in New Issue