Skip to content

Commit e50014f

Browse files
committed
Potential fix for pull request finding
This just makes the wording more accurate Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> server: auto-insert missing media markers in process_mtmd_prompt Fixes the /embedding endpoint when multimodal data is provided without corresponding media markers in the prompt string. Counts existing markers and prepends only the missing number so the count matches files.size(). Assisted-by: GitHub Copilot
1 parent 327c5a1 commit e50014f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tools/server/server-common.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,12 @@ server_tokens process_mtmd_prompt(mtmd_context * mctx, const std::string & promp
716716
}
717717

718718
// prepend missing markers so the count matches the number of files
719+
<<<<<<< HEAD
720+
// this mirrors the behavior in mtmd-cli.cpp, but also handles prompts that already contain some markers
721+
=======
719722
// this mirrors the behavior in mtmd-cli.cpp but also handles partial matches
720723
if (n_markers < files.size()) {
724+
>>>>>>> 327c5a188 (server: auto-insert missing media markers in process_mtmd_prompt)
721725
for (size_t i = 0; i < files.size() - n_markers; i++) {
722726
prompt_adj += marker;
723727
}

0 commit comments

Comments
 (0)