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'