]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llava : fix regression for square images in #3613 (#4056)
authorM. Yusuf Sarıgöz <redacted>
Mon, 13 Nov 2023 15:20:52 +0000 (18:20 +0300)
committerGitHub <redacted>
Mon, 13 Nov 2023 15:20:52 +0000 (18:20 +0300)
examples/llava/clip.cpp

index c26ee4957090c87b9e035294781498018c79e974..fc0656c231a0cf1e6a0f94bd60a49181e423da75 100644 (file)
@@ -761,7 +761,7 @@ bool clip_image_preprocess(const clip_ctx * ctx, const clip_image_u8 * img, clip
         temp->ny   = img->ny;
         temp->size = img->size;
         temp->data = new uint8_t[temp->size]();
-        *temp->data = *img->data; // copy
+        memcpy(&temp->data[0], &img->data[0], temp->size); // copy
     }
 
     const int nx = temp->nx;