Skip to content

Commit 1dfebf0

Browse files
Fix condition for reading feature layers
Signed-off-by: Alex-Brooks <[email protected]>
1 parent c380976 commit 1dfebf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/llava/clip.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ struct clip_ctx * clip_model_load(const char * fname, const int verbosity = 1) {
14961496

14971497
const int32_t * vision_feature_layer = (const int32_t *)gguf_get_arr_data(ctx, idx);
14981498

1499-
for (int i = 0; i < MAX_IMAGE_FEATURE_LAYERS && i < n && vision_feature_layer[i] != 0; ++i) {
1499+
for (int i = 0; i < MAX_IMAGE_FEATURE_LAYERS && i < n && vision_feature_layer[i] >= 0; ++i) {
15001500
hparams.vision_feature_layer[i] = vision_feature_layer[i];
15011501
}
15021502
if (n < MAX_IMAGE_FEATURE_LAYERS)

0 commit comments

Comments
 (0)