Skip to content

Commit 6e65e0c

Browse files
committed
fix regression
1 parent 346d252 commit 6e65e0c

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tools/mtmd/clip.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3496,6 +3496,11 @@ int clip_n_output_tokens(const struct clip_ctx * ctx, struct clip_image_f32 * im
34963496
projector_type proj = ctx->proj_type();
34973497

34983498
switch (proj) {
3499+
case PROJECTOR_TYPE_MLP:
3500+
case PROJECTOR_TYPE_MLP_NORM:
3501+
{
3502+
// do nothing
3503+
} break;
34993504
case PROJECTOR_TYPE_LDP:
35003505
case PROJECTOR_TYPE_LDPV2:
35013506
case PROJECTOR_TYPE_GLM_EDGE:

tools/mtmd/mtmd.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct mtmd_context {
103103
bool print_timings;
104104
int n_threads;
105105
std::string media_marker;
106-
const bool n_embd_text;
106+
const int n_embd_text;
107107

108108
// these are not token, but strings used to mark the beginning and end of image/audio embeddings
109109
std::string img_beg;
@@ -237,11 +237,6 @@ struct mtmd_context {
237237
ov_img_first = false; // overview image is last
238238
}
239239

240-
if (ctx_a && clip_has_whisper_encoder(ctx_a)) {
241-
// TODO @ngxson : check if model n_mel is 128 or 80
242-
w_filters = whisper_precalc_filters::get_128_bins();
243-
}
244-
245240
// set boi/eoi
246241
if (proj == PROJECTOR_TYPE_GEMMA3) {
247242
// <start_of_image> ... (image embeddings) ... <end_of_image>
@@ -281,6 +276,11 @@ struct mtmd_context {
281276
GGML_ASSERT(ctx_a != nullptr);
282277
projector_type proj = clip_get_projector_type(ctx_a);
283278

279+
if (clip_has_whisper_encoder(ctx_a)) {
280+
// TODO @ngxson : check if model n_mel is 128 or 80
281+
w_filters = whisper_precalc_filters::get_128_bins();
282+
}
283+
284284
LOG_WRN("%s: audio input is in experimental stage and may have reduced quality:\n"
285285
" https://github.com/ggml-org/llama.cpp/discussions/13759\n", __func__);
286286

0 commit comments

Comments
 (0)