Skip to content

Commit 00e0632

Browse files
committed
Use snapshot_download for test model fetch
1 parent 4608375 commit 00e0632

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,27 @@ jobs:
154154
python -m pip install huggingface_hub mlx mlx-lm
155155
156156
- name: Download test model from HuggingFace
157+
env:
158+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
157159
run: |
158160
mkdir -p models
159-
hf download mlx-community/Qwen1.5-0.5B-Chat-4bit --local-dir models/Qwen1.5-0.5B-Chat-4bit --local-dir-use-symlinks False
161+
python - <<'PY'
162+
import os
163+
from pathlib import Path
164+
165+
from huggingface_hub import snapshot_download
166+
167+
target_dir = Path("models/Qwen1.5-0.5B-Chat-4bit")
168+
target_dir.mkdir(parents=True, exist_ok=True)
169+
170+
snapshot_download(
171+
repo_id="mlx-community/Qwen1.5-0.5B-Chat-4bit",
172+
local_dir=str(target_dir),
173+
local_dir_use_symlinks=False,
174+
token=os.environ.get("HF_TOKEN") or None,
175+
resume_download=True,
176+
)
177+
PY
160178
echo "Model files:"
161179
ls -la models/Qwen1.5-0.5B-Chat-4bit/
162180

0 commit comments

Comments
 (0)