Files
wehub-resource-sync edf74f4e18
Build and Deploy Sphinx Docs / deploy (push) Has been skipped
tests / tests (ubuntu-latest, 3.11, 4.57.1) (push) Failing after 1s
tests / tests (ubuntu-latest, 3.13, ) (push) Failing after 1s
docker / build (cuda) (push) Failing after 1s
docker / build (npu-a3) (push) Failing after 1s
tests / tests (ubuntu-latest, 3.11, ) (push) Failing after 1s
docker / build (npu-a2) (push) Failing after 1s
Build and Deploy Sphinx Docs / build (push) Failing after 1s
tests / tests (ubuntu-latest, 3.11, 4.55.0) (push) Failing after 0s
tests / tests (ubuntu-latest, 3.12, ) (push) Failing after 1s
tests / tests (windows-latest, 3.11, ) (push) Has been cancelled
tests / tests (windows-latest, 3.12, ) (push) Has been cancelled
tests / tests (macos-latest, 3.11, ) (push) Has been cancelled
tests / tests (macos-latest, 3.12, ) (push) Has been cancelled
tests / tests (macos-latest, 3.13, ) (push) Has been cancelled
tests / tests (windows-latest, 3.13, ) (push) Has been cancelled
tests_cuda / tests (linux-x86_64-gpu-2, 3.11) (push) Has been cancelled
tests_npu / tests (linux-aarch64-a2-4, 3.11, 2.7.1) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:11:53 +08:00

63 lines
1.7 KiB
Docker

# https://hub.docker.com/r/hiyouga/pytorch/tags
ARG BASE_IMAGE=hiyouga/pytorch:th2.6.0-cu124-flashattn2.7.4-cxx11abi0-devel
FROM ${BASE_IMAGE}
# Installation arguments
ARG PIP_INDEX=https://pypi.org/simple
ARG INSTALL_FLASHATTN=false
ARG HTTP_PROXY=""
# Define environments
ENV MAX_JOBS=16
ENV FLASH_ATTENTION_FORCE_BUILD=TRUE
ENV VLLM_WORKER_MULTIPROC_METHOD=spawn
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_OPTIONS=""
ENV PIP_ROOT_USER_ACTION=ignore
ENV http_proxy="${HTTP_PROXY}"
ENV https_proxy="${HTTP_PROXY}"
# Use Bash instead of default /bin/sh
SHELL ["/bin/bash", "-c"]
# Set the working directory
WORKDIR /app
# Change pip source
RUN pip config set global.index-url "${PIP_INDEX}" && \
pip config set global.extra-index-url "${PIP_INDEX}" && \
pip install --no-cache-dir --upgrade pip packaging wheel setuptools editables "hatchling>=1.18.0"
# Copy the application into the image
COPY . /app
# Install LLaMA Factory
RUN pip install --no-cache-dir --no-build-isolation -e . && \
pip install --no-cache-dir --no-build-isolation -r requirements/metrics.txt -r requirements/deepspeed.txt
# Rebuild flash attention
RUN if [ "${INSTALL_FLASHATTN}" == "true" ]; then \
pip uninstall -y ninja && \
pip install --no-cache-dir ninja && \
pip install --no-cache-dir flash-attn --no-build-isolation; \
fi
# Set up volumes
# VOLUME [ "/root/.cache/huggingface", "/app/shared_data", "/app/output" ]
# Expose port 7860 for LLaMA Board
ENV GRADIO_SERVER_PORT=7860
EXPOSE 7860
# Expose port 8000 for API service
ENV API_PORT=8000
EXPOSE 8000
# unset proxy
ENV http_proxy=
ENV https_proxy=
# Reset pip config
RUN pip config unset global.index-url && \
pip config unset global.extra-index-url