]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
mtmd: fix silent prompt truncation on embedded NUL (#25548)
authorPascal <redacted>
Sun, 12 Jul 2026 22:47:25 +0000 (00:47 +0200)
committerGitHub <redacted>
Sun, 12 Jul 2026 22:47:25 +0000 (00:47 +0200)
commit4114ba18b208c2e9c1689a8316d410e649309dbc
treec87c3d2ecfb6fcdf354de8dab875ec8ec5f0a445
parent0c4fa7a989f94a9fef9e52a887e3376bb60d0848
mtmd: fix silent prompt truncation on embedded NUL (#25548)

* mtmd: fix silent prompt truncation on embedded NUL

mtmd_input_text carried the prompt as a bare const char* with no
length, so a NUL byte in message content cut the prompt at the
tokenizer boundary and dropped every later message plus the assistant
marker, with no log. Add an explicit text_len and thread it through,
matching llama_tokenize and the text only path.

* cleanup

---------

Co-authored-by: Xuan Son Nguyen <redacted>
tools/mtmd/mtmd-cli.cpp
tools/mtmd/mtmd.cpp
tools/mtmd/mtmd.h
tools/server/server-common.cpp