@@ -244,8 +244,6 @@ struct clip_vision_model {
244
244
// GLMV-Edge projection
245
245
struct ggml_tensor * mm_model_adapter_conv_w = nullptr ;
246
246
struct ggml_tensor * mm_model_adapter_conv_b = nullptr ;
247
- struct ggml_tensor * boi_w = nullptr ;
248
- struct ggml_tensor * eoi_w = nullptr ;
249
247
250
248
// MobileVLM projection
251
249
struct ggml_tensor * mm_model_mlp_1_w = nullptr ;
@@ -1697,8 +1695,6 @@ struct clip_model_loader {
1697
1695
vision_model.mm_model_mlp_1_w = get_tensor (string_format (TN_GLM_ADAPTER_D_H_2_4H," weight" ));
1698
1696
vision_model.mm_model_mlp_2_w = get_tensor (string_format (TN_GLM_ADAPTER_GATE," weight" ));
1699
1697
vision_model.mm_model_mlp_3_w = get_tensor (string_format (TN_GLM_ADAPTER_D_4H_2_H," weight" ));
1700
- vision_model.boi_w = get_tensor (TN_GLM_BOI_W);
1701
- vision_model.eoi_w = get_tensor (TN_GLM_EOI_W);
1702
1698
} break ;
1703
1699
case PROJECTOR_TYPE_MERGER:
1704
1700
{
@@ -2593,8 +2589,7 @@ void clip_free(clip_ctx * ctx) {
2593
2589
}
2594
2590
2595
2591
size_t clip_embd_nbytes (const struct clip_ctx * ctx) {
2596
- int extra_tokens = ctx->has_glm_projector ? 2 : 0 ;
2597
- return (clip_n_patches (ctx) + extra_tokens) * clip_n_mmproj_embd (ctx) * sizeof (float );
2592
+ return clip_n_patches (ctx) * clip_n_mmproj_embd (ctx) * sizeof (float );
2598
2593
}
2599
2594
2600
2595
size_t clip_embd_nbytes_by_img (const struct clip_ctx * ctx, int img_h, int img_w) {
@@ -2790,9 +2785,6 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima
2790
2785
}
2791
2786
if (ctx->has_glm_projector ) {
2792
2787
GGML_ASSERT (batch_size == 1 );
2793
- ggml_tensor * boi = ctx->vision_model .boi_w ;
2794
- ggml_backend_tensor_get (boi,vec,0 ,ggml_nbytes (boi));
2795
- vec = (float *)(vec+ggml_nelements (boi)); // offset for boi
2796
2788
}
2797
2789
2798
2790
// build the inference graph
@@ -3001,13 +2993,6 @@ bool clip_image_batch_encode(clip_ctx * ctx, const int n_threads, const clip_ima
3001
2993
// copy the embeddings to the location passed by the user
3002
2994
ggml_backend_tensor_get (embeddings, vec, 0 , ggml_nbytes (embeddings));
3003
2995
3004
- if (ctx->has_glm_projector ) {
3005
- // eoi
3006
- ggml_tensor * eoi = ctx->vision_model .eoi_w ;
3007
- int offset = ggml_nelements (embeddings);
3008
- ggml_backend_tensor_get (eoi, vec+offset, 0 , ggml_nbytes (eoi));
3009
- }
3010
-
3011
2996
return true ;
3012
2997
}
3013
2998
0 commit comments