Skip to content

Commit 37e24b1

Browse files
committed
fix qwen2vl norm (2)
1 parent 56b41af commit 37e24b1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

tools/mtmd/clip.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -664,12 +664,9 @@ struct clip_graph {
664664

665665
ggml_tensor * cur = inpL; // inpL = residual, cur = hidden_states
666666

667-
// rmsnorm1
668-
cur = ggml_rms_norm(ctx0, cur, eps);
669-
cur = ggml_mul(ctx0, cur, model.layers[il].ln_1_w);
670-
if (model.layers[il].ln_1_b) {
671-
cur = ggml_add(ctx0, cur, model.layers[il].ln_1_b);
672-
}
667+
// layernorm1
668+
cur = build_norm(cur, layer.ln_1_w, layer.ln_1_b, norm_t, eps, il);
669+
cb(cur, "ln1", il);
673670

674671
// self-attention
675672
{

0 commit comments

Comments
 (0)