@@ -1596,7 +1596,6 @@ struct clip_graph {
1596
1596
cur = build_norm (cur, model.mm_post_fc_norm_w , model.mm_post_fc_norm_b , NORM_TYPE_NORMAL, 1e-5 , -1 );
1597
1597
1598
1598
// Apply GELU
1599
- // TODO: Not 100% sure about gelu and silu configuration
1600
1599
cur = ggml_gelu_inplace (ctx0, cur);
1601
1600
1602
1601
// Branch 1: multiply with mm_h_to_4h_w
@@ -1606,16 +1605,12 @@ struct clip_graph {
1606
1605
ggml_tensor * gate = ggml_mul_mat (ctx0, model.mm_gate_w , cur);
1607
1606
1608
1607
// Apply silu
1609
- gate = ggml_silu_inplace (ctx0, gate);
1610
-
1611
- // Multiply together
1612
- cur = ggml_mul (ctx0, gate, h_to_4h);
1608
+ gate = ggml_swiglu_split (ctx0, gate, h_to_4h);
1613
1609
1614
1610
// Apply mm_4h_to_h_w
1615
- cur = ggml_mul_mat (ctx0, model.mm_4h_to_h_w , cur );
1611
+ cur = ggml_mul_mat (ctx0, model.mm_4h_to_h_w , gate );
1616
1612
1617
1613
// Concatenate with boi and eoi
1618
- // TODO: The shape may be incorrect
1619
1614
cur = ggml_concat (ctx0, model.mm_boi , cur, 1 );
1620
1615
cur = ggml_concat (ctx0, cur, model.mm_eoi , 1 );
1621
1616
0 commit comments