Skip to content

Commit 31be1a9

Browse files
committed
Rollback default marker placement changes
1 parent b81928f commit 31be1a9

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

tools/mtmd/mtmd-cli.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ int main(int argc, char ** argv) {
313313
g_is_generating = true;
314314
if (params.prompt.find(mtmd_default_marker()) == std::string::npos) {
315315
for (size_t i = 0; i < params.image.size(); i++) {
316-
params.prompt = mtmd::mtmd_add_default_marker(ctx.ctx_vision.get(), params.prompt);
316+
params.prompt += mtmd_default_marker();
317317
}
318318
}
319319
common_chat_msg msg;
@@ -378,7 +378,7 @@ int main(int argc, char ** argv) {
378378
std::string media_path = line.substr(7);
379379
if (ctx.load_media(media_path)) {
380380
LOG("%s %s loaded\n", media_path.c_str(), is_image ? "image" : "audio");
381-
content = mtmd::mtmd_add_default_marker(ctx.ctx_vision.get(), content);
381+
content += mtmd_default_marker();
382382
}
383383
// else, error is already printed by libmtmd
384384
continue;

tools/mtmd/mtmd.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,12 +1103,3 @@ void mtmd_log_set(ggml_log_callback log_callback, void * user_data) {
11031103
g_logger_state.log_callback = log_callback ? log_callback : clip_log_callback_default;
11041104
g_logger_state.log_callback_user_data = user_data;
11051105
}
1106-
1107-
std::string mtmd::mtmd_add_default_marker(mtmd_context *ctx, const std::string &str) {
1108-
// for LFM2 image embeddings positioned before the text
1109-
if (ctx && ctx->ctx_v && clip_get_projector_type(ctx->ctx_v) == PROJECTOR_TYPE_LFM2) {
1110-
return mtmd_default_marker() + str;
1111-
}
1112-
1113-
return str + mtmd_default_marker();
1114-
}

tools/mtmd/mtmd.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,9 +299,6 @@ struct input_chunks {
299299
}
300300
};
301301

302-
// insert mtmd_default_marker() into given string, position depends on the projector
303-
std::string mtmd_add_default_marker(mtmd_context *ctx, const std::string &str);
304-
305302
} // namespace mtmd
306303

307304
#endif

0 commit comments

Comments
 (0)