From 5bc1815ebcb2b246775f6218d0c690c5aadc1b3c Mon Sep 17 00:00:00 2001 From: plean Date: Wed, 18 Nov 2026 02:38:41 +0000 Subject: [PATCH] setup.sh: verify weight downloads (size + presence guards); download path exercised (206 range fetches, magic bytes, PR-rev URL, totals 1.08 GB / 281 MB) --- setup.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/setup.sh b/setup.sh index 30908b6..7878865 100755 --- a/setup.sh +++ b/setup.sh @@ -65,6 +65,16 @@ if [[ $SKIP_WEIGHTS == 0 ]]; then # YOLOv9-E icon detector (upstream recommends the icon_detect_v3 revision) curl -fSL --retry 3 -o weights/icon_detect_v3/model.pt \ "https://huggingface.co/microsoft/OmniParser-v2.0/resolve/refs%2Fpr%2F37/icon_detect_v3/model.pt" + # fail at setup, not as a cryptic model-load crash at boot + for f in weights/icon_caption_florence/model.safetensors weights/icon_detect_v3/model.pt; do + [[ $(stat -c%s "$f" 2>/dev/null || echo 0) -gt 100000000 ]] || { + echo "FAILED: $f missing or truncated (got $(stat -c%s "$f" 2>/dev/null || echo 0) bytes)" + echo " (HTML error pages land here too - check network/HF status)"; exit 1; } + done + for f in weights/icon_caption_florence/config.json weights/icon_caption_florence/generation_config.json; do + test -s "$f" || { echo "FAILED: $f empty"; exit 1; } + done + echo "== weights verified" fi .venv/bin/python - <<'EOF'