Skip to content

Commit cb51d4e

Browse files
committed
fix: Allow batch encoding and remove clip_is_idefics3
Branch: GraniteDocling Signed-off-by: Gabe Goodhart <[email protected]>
1 parent f5a7f4d commit cb51d4e

File tree

3 files changed

+1
-7
lines changed

3 files changed

+1
-7
lines changed

tools/mtmd/clip.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4426,10 +4426,6 @@ bool clip_is_gemma3(const struct clip_ctx * ctx) {
44264426
return ctx->proj_type() == PROJECTOR_TYPE_GEMMA3;
44274427
}
44284428

4429-
bool clip_is_idefics3(const struct clip_ctx * ctx) {
4430-
return ctx->proj_type() == PROJECTOR_TYPE_IDEFICS3;
4431-
}
4432-
44334429
bool clip_has_vision_encoder(const struct clip_ctx * ctx) {
44344430
return ctx->model.modality == CLIP_MODALITY_VISION;
44354431
}

tools/mtmd/clip.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ bool clip_is_glm(const struct clip_ctx * ctx);
9595
bool clip_is_qwen2vl(const struct clip_ctx * ctx);
9696
bool clip_is_llava(const struct clip_ctx * ctx);
9797
bool clip_is_gemma3(const struct clip_ctx * ctx);
98-
bool clip_is_idefics3(const struct clip_ctx * ctx);
9998

10099
bool clip_encode_float_image (struct clip_ctx * ctx, int n_threads, float * img, int h, int w, float * vec);
101100

tools/mtmd/mtmd.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,8 +796,7 @@ int32_t mtmd_encode(mtmd_context * ctx, const mtmd_image_tokens * image_tokens)
796796

797797
if (clip_is_llava(ctx_clip)
798798
|| clip_is_minicpmv(ctx_clip)
799-
|| clip_is_glm(ctx_clip)
800-
|| clip_is_idefics3(ctx_clip)) {
799+
|| clip_is_glm(ctx_clip)) {
801800
// TODO @ngxson : llava does not support batched encoding ; this should be fixed inside clip_image_batch_encode()
802801
const auto & entries = image_tokens->batch_f32.entries;
803802
for (size_t i = 0; i < entries.size(); i++) {

0 commit comments

Comments
 (0)