@@ -17,28 +17,49 @@ MODELS=(
1717 " models/Qwen3-0.6B-Q4_K_M.gguf"
1818)
1919
20- echo " Validating model files..."
21- for model in " ${MODELS[@]} " ; do
20+ # Optional GGUFs validated only when present so jobs that do not download
21+ # them (e.g. cross-compile smoke runs) still pass. The vision test image is
22+ # committed to src/test/resources/images/test-image.jpg and is not validated
23+ # here — its presence is asserted directly by MultimodalIntegrationTest.
24+ OPTIONAL_MODELS=(
25+ " models/nomic-embed-text-v1.5.f16.gguf"
26+ " models/SmolVLM-500M-Instruct-Q8_0.gguf"
27+ " models/mmproj-SmolVLM-500M-Instruct-Q8_0.gguf"
28+ )
29+
30+ validate_gguf () {
31+ local model=" $1 "
32+ local required=" $2 "
2233 if [[ ! -f " $model " ]]; then
23- echo " ERROR: Model not found: $model "
24- exit 1
34+ if [[ " $required " == " required" ]]; then
35+ echo " ERROR: Model not found: $model "
36+ exit 1
37+ else
38+ echo " - $model (optional, skipped: not present)"
39+ return
40+ fi
2541 fi
26-
27- # Check file size (must be > 4 bytes for magic header)
42+ local size
2843 size=$( stat -f%z " $model " 2> /dev/null || stat -c%s " $model " 2> /dev/null)
2944 if [[ $size -lt 4 ]]; then
3045 echo " ERROR: Model file too small (likely corrupted): $model (size: $size bytes)"
3146 exit 1
3247 fi
33-
34- # Check GGUF magic bytes: 0x47 0x47 0x55 0x46
48+ local magic
3549 magic=$( xxd -p -l 4 " $model " )
3650 if [[ " $magic " != " 47475546" ]]; then
3751 echo " ERROR: Invalid GGUF magic bytes in $model (got: $magic , expected: 47475546)"
3852 exit 1
3953 fi
40-
4154 echo " ✓ $model ($( numfmt --to=iec-i --suffix=B $size 2> /dev/null || echo $size bytes) )"
55+ }
56+
57+ echo " Validating model files..."
58+ for model in " ${MODELS[@]} " ; do
59+ validate_gguf " $model " required
60+ done
61+ for model in " ${OPTIONAL_MODELS[@]} " ; do
62+ validate_gguf " $model " optional
4263done
4364
4465echo " All models validated successfully!"
0 commit comments