gemma3 now works correctly

This commit is contained in:
Concedo 2025-03-13 14:34:18 +08:00
parent 57c9523405
commit 16137f4281

View file

@ -2763,6 +2763,10 @@ int clip_n_patches_by_img(const struct clip_ctx * ctx, struct clip_image_f32 * i
const auto & params = ctx->vision_model.hparams;
int n_patches = (params.image_size / params.patch_size) * (params.image_size / params.patch_size);
if (ctx->proj_type == PROJECTOR_TYPE_GEMMA3)
{
n_patches = 256; //kcpp hardcode gemma3 vision to 256 size
}
if (ctx->proj_type == PROJECTOR_TYPE_LDP || ctx->proj_type == PROJECTOR_TYPE_LDPV2 || ctx->proj_type == PROJECTOR_TYPE_GLM_EDGE) {
n_patches /= 4;