Skip to content

Commit 70e7312

Browse files
committed
fix model load
1 parent bd38d7f commit 70e7312

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

tools/mtmd/clip.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2776,6 +2776,7 @@ struct clip_model_loader {
27762776
} break;
27772777
case PROJECTOR_TYPE_LFM2:
27782778
case PROJECTOR_TYPE_KIMIVL:
2779+
case PROJECTOR_TYPE_PADDLEOCR:
27792780
{
27802781
model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM);
27812782
model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B);
@@ -2840,27 +2841,6 @@ struct clip_model_loader {
28402841
model.mm_model_mlp_1_w = get_tensor(string_format(TN_MVLM_PROJ_MLP, 1, "weight"));
28412842
model.mm_model_mlp_2_w = get_tensor(string_format(TN_MVLM_PROJ_MLP, 2, "weight"));
28422843
} break;
2843-
case PROJECTOR_TYPE_PADDLEOCR:
2844-
{
2845-
model.mm_model_query = get_tensor(TN_RESAMPL_QUERY);
2846-
model.mm_model_attn_q_w = get_tensor(string_format(TN_RESAMPL_ATTN, "q", "weight"));
2847-
model.mm_model_attn_k_w = get_tensor(string_format(TN_RESAMPL_ATTN, "k", "weight"));
2848-
model.mm_model_attn_v_w = get_tensor(string_format(TN_RESAMPL_ATTN, "v", "weight"));
2849-
model.mm_model_attn_q_b = get_tensor(string_format(TN_RESAMPL_ATTN, "q", "bias"));
2850-
model.mm_model_attn_k_b = get_tensor(string_format(TN_RESAMPL_ATTN, "k", "bias"));
2851-
model.mm_model_attn_v_b = get_tensor(string_format(TN_RESAMPL_ATTN, "v", "bias"));
2852-
model.mm_model_attn_o_w = get_tensor(string_format(TN_RESAMPL_ATTN, "out", "weight"));
2853-
model.mm_model_attn_o_b = get_tensor(string_format(TN_RESAMPL_ATTN, "out", "bias"));
2854-
model.mm_model_ln_post_w = get_tensor(string_format(TN_RESAMPL_LN, "post", "weight"));
2855-
model.mm_model_ln_post_b = get_tensor(string_format(TN_RESAMPL_LN, "post", "bias"));
2856-
// projector ffn
2857-
model.mm_1_w = get_tensor(string_format(TN_LLAVA_PROJ, 1, "weight"));
2858-
model.mm_1_b = get_tensor(string_format(TN_LLAVA_PROJ, 1, "bias"));
2859-
model.mm_2_w = get_tensor(string_format(TN_LLAVA_PROJ, 2, "weight"));
2860-
model.mm_2_b = get_tensor(string_format(TN_LLAVA_PROJ, 2, "bias"));
2861-
model.mm_input_norm_w = get_tensor(TN_MM_INP_NORM);
2862-
model.mm_input_norm_b = get_tensor(TN_MM_INP_NORM_B);
2863-
} break;
28642844
default:
28652845
GGML_ASSERT(false && "unknown projector type");
28662846
}

0 commit comments

Comments
 (0)