Skip to content

Commit bd69518

Browse files
committed
ci : add HF_TOKEN secret for HF download authorization
This is to avoid the HR rate limiting when downloading model.
1 parent 8a4dec5 commit bd69518

5 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/build-coreml.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
echo "GEN_MODEL_NAME=whisper-${TAG_NAME}-ggml-base.en-encoder.mlmodelc" >> $GITHUB_ENV
5353
5454
- name: Download model
55+
env:
56+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
5557
run: |
5658
./models/download-ggml-model.sh ${{ env.MODEL_NAME }}
5759

.github/workflows/build-cpu.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ jobs:
5555
5656
- name: Test
5757
id: ggml-ci
58+
env:
59+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
5860
run: |
5961
LLAMA_ARG_THREADS=$(nproc) GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
6062
@@ -81,6 +83,8 @@ jobs:
8183
8284
- name: Test
8385
id: ggml-ci
86+
env:
87+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
8488
run: |
8589
LLAMA_ARG_THREADS=$(nproc) GG_BUILD_LOW_PERF=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
8690
@@ -107,6 +111,8 @@ jobs:
107111
108112
- name: Test
109113
id: ggml-ci
114+
env:
115+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
110116
run: |
111117
LLAMA_ARG_THREADS=$(nproc) bash ./ci/run.sh ./tmp/results ./tmp/mnt
112118
@@ -133,6 +139,8 @@ jobs:
133139
134140
- name: Test
135141
id: ggml-ci
142+
env:
143+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
136144
run: |
137145
LLAMA_ARG_THREADS=$(nproc) GG_BUILD_NO_SVE=1 GG_BUILD_NO_BF16=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt
138146
@@ -159,5 +167,7 @@ jobs:
159167
160168
- name: Test
161169
id: ggml-ci
170+
env:
171+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
162172
run: |
163173
LLAMA_ARG_THREADS=$(nproc) GG_BUILD_NO_BF16=1 GG_BUILD_EXTRA_TESTS_0=1 bash ./ci/run.sh ./tmp/results ./tmp/mnt

.github/workflows/build-quantize.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
uses: actions/checkout@v6
3333

3434
- name: Test quantize
35+
env:
36+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
3537
run: |
3638
./models/download-ggml-model.sh tiny.en
3739
cmake -B build

.github/workflows/examples.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
run: npx cmake-js compile -T addon.node -B Release
4343

4444
- name: Download test model
45+
env:
46+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
4547
run: |
4648
bash ./models/download-ggml-model.sh base.en
4749
- name: Test

models/download-ggml-model.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ elif [ -x "$(command -v curl)" ]; then
125125
--retry-delay 5 \
126126
--retry-all-errors \
127127
--retry-connrefused \
128+
${HF_TOKEN:+--header "Authorization: Bearer $HF_TOKEN"} \
128129
--output ggml-"$model".bin $src/$pfx-"$model".bin
129130
elif [ -x "$(command -v wget)" ]; then
130131
wget --no-config --quiet --show-progress -O ggml-"$model".bin $src/$pfx-"$model".bin

0 commit comments

Comments
 (0)