mtmd : fix InternVL CLS token order (#30886)

This commit is contained in:
bosh authored and GitHub committed 2026-11-01 00:30:01 +01:00
1 parent 79bce0c881
commit d5ef408e20
1 file changed
+2 -2
+2 -2
View File
@@ -10,7 +10,7 @@ ggml_cgraph * clip_graph_internvl::build() {
// add CLS token
ggml_tensor * cls_repeated = ggml_repeat_4d(ctx0, model.class_embedding,
model.class_embedding->ne[0], 1, n_batch, 1);
inp = ggml_concat(ctx0, inp, cls_repeated, 1);
inp = ggml_concat(ctx0, cls_repeated, inp, 1);
// The larger models use a different ViT, which uses RMS norm instead of layer norm
// ref: https://github.com/ggml-org/llama.cpp/pull/13443#issuecomment-2869786188
@@ -28,7 +28,7 @@ ggml_cgraph * clip_graph_internvl::build() {
// remove CLS token
cur = ggml_view_3d(ctx0, cur,
n_embd, n_patches, n_batch,
cur->nb[1], cur->nb[2], 0);
cur->nb[1], cur->nb[2], cur->nb[1]);
cur = ggml_cont(ctx0, cur);
// pixel shuffle