[misc] fix ci (#7441)

* fix ci

* improve ci
This commit is contained in:
hoshi-hiyouga 2025-03-23 21:09:35 +08:00 committed by GitHub
parent fbf49e2500
commit c841e92116
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 5 deletions

View File

@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
python:
- "3.9"
- "3.10"
- "3.11"
@ -34,6 +34,10 @@ jobs:
runs-on: ${{ matrix.os }}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
OS_NAME: ${{ matrix.os }}
@ -45,7 +49,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python }}
cache: "pip"
cache-dependency-path: "setup.py"
@ -54,6 +58,12 @@ jobs:
python -m pip install --upgrade pip
python -m pip install ".[torch,dev]"
- name: Cache files
uses: actions/cache@v4
with:
path: ${{ runner.temp }}/huggingface
key: huggingface-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('tests/version.txt') }}
- name: Check quality
run: |
make style && make quality
@ -65,3 +75,5 @@ jobs:
- name: Test with pytest
run: |
make test
env:
HF_HOME: ${{ runner.temp }}/huggingface

View File

@ -1,5 +1,6 @@
transformers>=4.41.2,<=4.50.0,!=4.46.*,!=4.47.*,!=4.48.*;python_version<'3.10'
transformers>=4.41.2,<=4.50.0,!=4.46.*,!=4.47.*,!=4.48.0;python_version>='3.10'
transformers>=4.41.2,<=4.50.0,!=4.46.*,!=4.47.*,!=4.48.*;python_version<'3.10' and sys_platform != 'darwin'
transformers>=4.41.2,<=4.50.0,!=4.46.*,!=4.47.*,!=4.48.0;python_version>='3.10' and sys_platform != 'darwin'
transformers>=4.41.2,<=4.49.0,!=4.46.*,!=4.47.*,!=4.48.*;sys_platform == 'darwin'
datasets>=2.16.0,<=3.3.2
accelerate>=0.34.0,<=1.4.0
peft>=0.11.1,<=0.12.0

View File

@ -20,7 +20,7 @@ KEYWORDS = ("Copyright", "2025", "LlamaFactory")
def main():
path_list = []
path_list: list[Path] = []
for check_dir in sys.argv[1:]:
path_list.extend(Path(check_dir).glob("**/*.py"))

1
tests/version.txt Normal file
View File

@ -0,0 +1 @@
0.9.3.100