Commit 7bd180830 for llama.cpp
commit 7bd18083082126c08d375cefaa6a5aa1c170ecde
Author: bosh <98094229+boshjerns@users.noreply.github.com>
Date: Sun Nov 1 00:55:33 2026 +0700
mtmd : resize Gemma 4 images without letterbox padding (#30922)
* mtmd : resize Gemma 4 images without letterbox padding
* Apply suggestion from @ngxson
---------
Co-authored-by: Xuan-Son Nguyen <thichthat@gmail.com>
diff --git a/tools/mtmd/clip.cpp b/tools/mtmd/clip.cpp
index 767ad9f79..d723432a7 100644
--- a/tools/mtmd/clip.cpp
+++ b/tools/mtmd/clip.cpp
@@ -1842,6 +1842,7 @@ struct clip_model_loader {
log_ffn_op = "gelu";
hparams.n_merge = 3; // pooling_kernel_size
hparams.image_resize_algo = RESIZE_ALGO_BICUBIC;
+ hparams.image_resize_pad = PAD_NONE;
get_u32(KEY_PROJ_SCALE_FACTOR, hparams.n_merge, false);
if (model.proj_type == PROJECTOR_TYPE_GEMMA4UV) {
// for "unified" variant, we directly use a bigger patch size, because the "token merging" is done directly on conv layer