Skip to content

Commit d4fde4c

Browse files
committed
Use Qwen2 0.5B for ci tests
1 parent aa91ec0 commit d4fde4c

File tree

1 file changed

+45
-10
lines changed

1 file changed

+45
-10
lines changed

.github/workflows/test.yaml

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
name: Tests
2-
32
on:
43
pull_request:
54
branches:
@@ -8,14 +7,34 @@ on:
87
branches:
98
- main
109

10+
env:
11+
REPO_ID: Qwen/Qwen2-0.5B-Instruct-GGUF
12+
MODEL_FILE: qwen2-0_5b-instruct-q8_0.gguf
13+
1114
jobs:
12-
build-linux:
15+
download-model:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: "3.9"
22+
- name: Install huggingface-hub
23+
run: pip install huggingface-hub
24+
- name: Download model
25+
run: huggingface-hub download ${{ env.REPO_ID }} ${{ env.MODEL_FILE }}
26+
- name: Cache model
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/huggingface/hub
30+
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
1331

32+
build-linux:
33+
needs: download-model
1434
runs-on: ubuntu-latest
1535
strategy:
1636
matrix:
1737
python-version: ["3.9", "3.10", "3.11", "3.12"]
18-
1938
steps:
2039
- uses: actions/checkout@v4
2140
with:
@@ -25,6 +44,11 @@ jobs:
2544
with:
2645
python-version: ${{ matrix.python-version }}
2746
cache: 'pip'
47+
- name: Restore model cache
48+
uses: actions/cache@v3
49+
with:
50+
path: ~/.cache/huggingface/hub
51+
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
2852
- name: Install dependencies
2953
run: |
3054
python -m pip install --upgrade pip
@@ -34,12 +58,11 @@ jobs:
3458
python -m pytest
3559
3660
build-windows:
37-
61+
needs: download-model
3862
runs-on: windows-latest
3963
strategy:
4064
matrix:
4165
python-version: ["3.9", "3.10", "3.11", "3.12"]
42-
4366
steps:
4467
- uses: actions/checkout@v4
4568
with:
@@ -49,6 +72,11 @@ jobs:
4972
with:
5073
python-version: ${{ matrix.python-version }}
5174
cache: 'pip'
75+
- name: Restore model cache
76+
uses: actions/cache@v3
77+
with:
78+
path: ~/.cache/huggingface/hub
79+
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
5280
- name: Install dependencies
5381
run: |
5482
python -m pip install --upgrade pip
@@ -58,12 +86,11 @@ jobs:
5886
python -m pytest
5987
6088
build-macos:
61-
89+
needs: download-model
6290
runs-on: macos-latest
6391
strategy:
6492
matrix:
6593
python-version: ["3.9", "3.10", "3.11", "3.12"]
66-
6794
steps:
6895
- uses: actions/checkout@v4
6996
with:
@@ -73,6 +100,11 @@ jobs:
73100
with:
74101
python-version: ${{ matrix.python-version }}
75102
cache: 'pip'
103+
- name: Restore model cache
104+
uses: actions/cache@v3
105+
with:
106+
path: ~/.cache/huggingface/hub
107+
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
76108
- name: Install dependencies
77109
run: |
78110
python -m pip install --upgrade pip
@@ -81,11 +113,9 @@ jobs:
81113
run: |
82114
python -m pytest
83115
84-
85116
build-macos-metal:
86-
117+
needs: download-model
87118
runs-on: macos-latest
88-
89119
steps:
90120
- uses: actions/checkout@v4
91121
with:
@@ -94,6 +124,11 @@ jobs:
94124
uses: actions/setup-python@v5
95125
with:
96126
python-version: "3.9"
127+
- name: Restore model cache
128+
uses: actions/cache@v3
129+
with:
130+
path: ~/.cache/huggingface/hub
131+
key: ${{ runner.os }}-model-${{ env.REPO_ID }}-${{ env.MODEL_FILE }}
97132
- name: Install dependencies
98133
run: |
99134
python -m pip install --upgrade pip

0 commit comments

Comments
 (0)