mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-27 09:10:35 +08:00
fix
This commit is contained in:
7
.github/workflows/publish.yml
vendored
7
.github/workflows/publish.yml
vendored
@@ -23,10 +23,11 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Install uv
|
||||||
uses: actions/setup-python@v5
|
uses: astral-sh/setup-uv@v7
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.11"
|
||||||
|
github-token: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build package
|
- name: Build package
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
13
Makefile
13
Makefile
@@ -4,24 +4,25 @@ check_dirs := scripts src tests tests_v1
|
|||||||
|
|
||||||
RUN := $(shell command -v uv >/dev/null 2>&1 && echo "uv run" || echo "")
|
RUN := $(shell command -v uv >/dev/null 2>&1 && echo "uv run" || echo "")
|
||||||
BUILD := $(shell command -v uv >/dev/null 2>&1 && echo "uv build" || echo "python -m build")
|
BUILD := $(shell command -v uv >/dev/null 2>&1 && echo "uv build" || echo "python -m build")
|
||||||
|
TOOL := $(shell command -v uv >/dev/null 2>&1 && echo "uvx" || echo "")
|
||||||
|
|
||||||
build:
|
build:
|
||||||
$(BUILD)
|
$(BUILD)
|
||||||
|
|
||||||
commit:
|
commit:
|
||||||
$(RUN) pre-commit install
|
$(TOOL) pre-commit install
|
||||||
$(RUN) pre-commit run --all-files
|
$(TOOL) pre-commit run --all-files
|
||||||
|
|
||||||
license:
|
license:
|
||||||
$(RUN) python3 tests/check_license.py $(check_dirs)
|
$(RUN) python3 tests/check_license.py $(check_dirs)
|
||||||
|
|
||||||
quality:
|
quality:
|
||||||
$(RUN) ruff check $(check_dirs)
|
$(TOOL) ruff check $(check_dirs)
|
||||||
$(RUN) ruff format --check $(check_dirs)
|
$(TOOL) ruff format --check $(check_dirs)
|
||||||
|
|
||||||
style:
|
style:
|
||||||
$(RUN) ruff check $(check_dirs) --fix
|
$(TOOL) ruff check $(check_dirs) --fix
|
||||||
$(RUN) ruff format $(check_dirs)
|
$(TOOL) ruff format $(check_dirs)
|
||||||
|
|
||||||
test:
|
test:
|
||||||
WANDB_DISABLED=true $(RUN) pytest -vv --import-mode=importlib tests/ tests_v1/
|
WANDB_DISABLED=true $(RUN) pytest -vv --import-mode=importlib tests/ tests_v1/
|
||||||
|
|||||||
@@ -26,13 +26,13 @@ WORKDIR /app
|
|||||||
# Change pip source
|
# Change pip source
|
||||||
RUN pip config set global.index-url "${PIP_INDEX}" && \
|
RUN pip config set global.index-url "${PIP_INDEX}" && \
|
||||||
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
||||||
pip install --no-cache-dir --upgrade pip packaging wheel setuptools "hatchling>=1.18.0" editables
|
pip install --no-cache-dir --upgrade pip packaging wheel setuptools editables "hatchling>=1.18.0"
|
||||||
|
|
||||||
# Copy the application into the image
|
# Copy the application into the image
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install LLaMA Factory
|
# Install LLaMA Factory
|
||||||
RUN pip install --no-cache-dir -e ".[metrics,deepspeed]" --no-build-isolation
|
RUN pip install --no-cache-dir --no-build-isolation -e ".[metrics,deepspeed]"
|
||||||
|
|
||||||
# Rebuild flash attention
|
# Rebuild flash attention
|
||||||
RUN if [ "${INSTALL_FLASHATTN}" == "true" ]; then \
|
RUN if [ "${INSTALL_FLASHATTN}" == "true" ]; then \
|
||||||
|
|||||||
@@ -29,15 +29,13 @@ RUN pip config set global.index-url "${PIP_INDEX}" && \
|
|||||||
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
||||||
pip install --no-cache-dir --upgrade pip packaging wheel setuptools "hatchling>=1.18.0" editables
|
pip install --no-cache-dir --upgrade pip packaging wheel setuptools "hatchling>=1.18.0" editables
|
||||||
|
|
||||||
# Install torch-npu
|
|
||||||
RUN pip uninstall -y torch torchvision torchaudio && \
|
|
||||||
pip install --no-cache-dir "torch==2.7.1" "torch-npu==2.7.1" "torchvision==0.22.1" --index-url "${PYTORCH_INDEX}"
|
|
||||||
|
|
||||||
# Copy the application into the image
|
# Copy the application into the image
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install LLaMA Factory
|
# Install torch-npu
|
||||||
RUN pip install --no-cache-dir -e ".[metrics]" --no-build-isolation
|
RUN pip uninstall -y torch torchvision torchaudio && \
|
||||||
|
pip install --no-cache-dir --no-build-isolation -e ".[metrics]" \
|
||||||
|
"torch==2.7.1" "torch-npu==2.7.1" "torchvision==0.22.1" "torchaudio==2.7.1" --index-url "${PYTORCH_INDEX}"
|
||||||
|
|
||||||
# Set up volumes
|
# Set up volumes
|
||||||
# VOLUME [ "/root/.cache/huggingface", "/app/shared_data", "/app/output" ]
|
# VOLUME [ "/root/.cache/huggingface", "/app/shared_data", "/app/output" ]
|
||||||
|
|||||||
@@ -27,17 +27,14 @@ WORKDIR /app
|
|||||||
# Change pip source
|
# Change pip source
|
||||||
RUN pip config set global.index-url "${PIP_INDEX}" && \
|
RUN pip config set global.index-url "${PIP_INDEX}" && \
|
||||||
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
pip config set global.extra-index-url "${PIP_INDEX}" && \
|
||||||
pip install --no-cache-dir --upgrade pip packaging wheel setuptools "hatchling>=1.18.0" editables
|
pip install --no-cache-dir --upgrade pip packaging wheel setuptools editables "hatchling>=1.18.0"
|
||||||
|
|
||||||
# Reinstall pytorch rocm
|
|
||||||
RUN pip uninstall -y torch torchvision torchaudio && \
|
|
||||||
pip install --no-cache-dir --pre torch torchvision torchaudio --index-url "${PYTORCH_INDEX}"
|
|
||||||
|
|
||||||
# Copy the application into the image
|
# Copy the application into the image
|
||||||
COPY . /app
|
COPY . /app
|
||||||
|
|
||||||
# Install LLaMA Factory
|
# Reinstall pytorch rocm and install LLaMA Factory
|
||||||
RUN pip install --no-cache-dir -e ".[metrics,deepspeed]" --no-build-isolation
|
RUN pip uninstall -y torch torchvision torchaudio && \
|
||||||
|
pip install --no-cache-dir -e --pre ".[metrics,deepspeed]" --index-url "${PYTORCH_INDEX}"
|
||||||
|
|
||||||
# Rebuild flash attention
|
# Rebuild flash attention
|
||||||
RUN if [ "${INSTALL_FLASHATTN}" == "true" ]; then \
|
RUN if [ "${INSTALL_FLASHATTN}" == "true" ]; then \
|
||||||
|
|||||||
Reference in New Issue
Block a user