Skip to content

Commit 1609be0

Browse files
committed
correct a small bug
1 parent c282e40 commit 1609be0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/mtmd/clip.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3787,6 +3787,11 @@ int clip_n_output_tokens(const struct clip_ctx * ctx, struct clip_image_f32 * im
37873787
case PROJECTOR_TYPE_IDEFICS3:
37883788
case PROJECTOR_TYPE_INTERNVL:
37893789
case PROJECTOR_TYPE_LLAMA4:
3790+
{
3791+
// both X and Y are downscaled by the scale factor
3792+
int scale_factor = ctx->model.hparams.proj_scale_factor;
3793+
n_patches /= (scale_factor * scale_factor);
3794+
} break;
37903795
case PROJECTOR_TYPE_LFM2:
37913796
case PROJECTOR_TYPE_KIMIVL:
37923797
{

0 commit comments

Comments
 (0)