Skip to content

Commit 68adda0

Browse files
committed
model-downloader: tolerate huggingface_hub's bogus non-zero exit
After v0.0.186 added 'uvx --with click', the hf CLI starts downloading correctly but raises 'typer.Exit(0)' that doesn't get caught — Python exits non-zero despite the download succeeding ('✓ Downloaded' is in the log, snapshot path written). Wrap the uvx call with '|| true' and verify success by checking the HuggingFace snapshot directory. Removes 'set -e' since we now handle the uvx exit explicitly. Same fix for Qwen3.5-122B.yaml.
1 parent f1f0205 commit 68adda0

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

GLM-5.1.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ services:
3939
container_name: model-downloader
4040
command:
4141
- |
42-
set -e
4342
echo "Downloading zai-org/GLM-5.1-FP8..."
44-
uvx --with click --from 'huggingface_hub[hf_xet]' hf download zai-org/GLM-5.1-FP8 --revision f396cf805182f4ca10fa675e1a99815b3ca384db
43+
SNAPSHOT=/root/.cache/huggingface/hub/models--zai-org--GLM-5.1-FP8/snapshots/f396cf805182f4ca10fa675e1a99815b3ca384db
44+
# huggingface_hub's `hf` CLI raises `typer.Exit(0)` without catching it
45+
# in some releases, exiting non-zero despite the download succeeding.
46+
# Tolerate the spurious exit and verify success by snapshot path.
47+
uvx --with click --from 'huggingface_hub[hf_xet]' hf download zai-org/GLM-5.1-FP8 --revision f396cf805182f4ca10fa675e1a99815b3ca384db || true
48+
test -d "$SNAPSHOT" || { echo "Download verification failed: $SNAPSHOT missing"; exit 1; }
4549
echo "Download complete."
4650
volumes:
4751
- huggingface_cache:/root/.cache/huggingface

Qwen3.5-122B.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,13 @@ services:
8282
entrypoint: ["sh", "-c"]
8383
command:
8484
- |
85-
set -e
8685
echo "Downloading Qwen/Qwen3.5-122B-A10B..."
87-
uvx --with click --from 'huggingface_hub[hf_xet]' hf download Qwen/Qwen3.5-122B-A10B --revision dc4d348443bc740c68e2d77492492c11606384d5
86+
SNAPSHOT=/root/.cache/huggingface/hub/models--Qwen--Qwen3.5-122B-A10B/snapshots/dc4d348443bc740c68e2d77492492c11606384d5
87+
# huggingface_hub's `hf` CLI raises `typer.Exit(0)` without catching it
88+
# in some releases, exiting non-zero despite the download succeeding.
89+
# Tolerate the spurious exit and verify success by snapshot path.
90+
uvx --with click --from 'huggingface_hub[hf_xet]' hf download Qwen/Qwen3.5-122B-A10B --revision dc4d348443bc740c68e2d77492492c11606384d5 || true
91+
test -d "$SNAPSHOT" || { echo "Download verification failed: $SNAPSHOT missing"; exit 1; }
8892
echo "Download complete."
8993
volumes:
9094
- huggingface_cache:/root/.cache/huggingface

0 commit comments

Comments
 (0)