]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llaba : hotfix for llava-1.6 image number (#5495)
authorJohn <redacted>
Thu, 15 Feb 2024 07:59:18 +0000 (08:59 +0100)
committerGitHub <redacted>
Thu, 15 Feb 2024 07:59:18 +0000 (09:59 +0200)
Co-authored-by: John <redacted>
examples/llava/llava.cpp

index 22953417f0975137eafdd640af33016edf8b5fe7..4ed310a0e7f73a4e470cad8b976ae2a2523175d1 100644 (file)
@@ -100,7 +100,7 @@ static bool clip_llava_handle_patches(clip_ctx * ctx_clip, std::vector<float *>
     int num_patches_width  = grid_shape.first;  // grid 1-4
     int num_patches_height = grid_shape.second; // grid 1-4
 
-    const size_t num_images = num_patches_width + num_patches_height + 1;
+    const size_t num_images = num_patches_width * num_patches_height + 1;
 
     // TODO: size calculation is not calculated - it's only tens of MB
     size_t ctx_size = 0;