Skip to content

Commit 496f1ce

Browse files
committed
correct order W, H of clip_embd_nbytes_by_img
1 parent e9bff42 commit 496f1ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

examples/llava/clip.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2829,10 +2829,10 @@ void clip_free(clip_ctx * ctx) {
28292829
size_t clip_embd_nbytes(const struct clip_ctx * ctx) {
28302830
const int32_t nx = ctx->vision_model.hparams.image_size;
28312831
const int32_t ny = ctx->vision_model.hparams.image_size;
2832-
return clip_embd_nbytes_by_img(ctx, ny, nx);
2832+
return clip_embd_nbytes_by_img(ctx, nx, ny);
28332833
}
28342834

2835-
size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_h, int img_w) {
2835+
size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_w, int img_h) {
28362836
clip_image_f32 img;
28372837
img.nx = img_w;
28382838
img.ny = img_h;

examples/llava/clip.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ CLIP_API struct clip_ctx * clip_init(const char * fname, struct clip_context_par
4747
CLIP_API void clip_free(struct clip_ctx * ctx);
4848

4949
CLIP_API size_t clip_embd_nbytes(const struct clip_ctx * ctx);
50-
CLIP_API size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_h, int img_w);
50+
CLIP_API size_t clip_embd_nbytes_by_img(const struct clip_ctx * ctx, int img_w, int img_h);
5151

5252
CLIP_API int32_t clip_get_image_size (const struct clip_ctx * ctx);
5353
CLIP_API int32_t clip_get_patch_size (const struct clip_ctx * ctx);

0 commit comments

Comments
 (0)