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)

This commit is contained in:
plean committed 2026-11-18 02:38:41 +00:00
1 parent 392fa6326f
commit 5bc1815ebc
1 file changed
+10
+10
View File
@@ -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'