Skip to content

Commit 1762647

Browse files
committed
Update Submodule vendor/llama.cpp e3546c7..7f575c3
Signed-off-by: JamePeng <jame_peng@sina.com>
1 parent e417924 commit 1762647

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

llama_cpp/llama_multimodal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,9 @@ def _mtmd_tokenize(
727727
)
728728

729729
input_text = self._mtmd_cpp.mtmd_input_text()
730-
input_text.text = ctypes.c_char_p(text.encode("utf-8"))
730+
encoded_text = text.encode("utf-8")
731+
input_text.text = ctypes.c_char_p(encoded_text)
732+
input_text.text_len = len(encoded_text)
731733
input_text.add_special = (llama.n_tokens == 0)
732734
input_text.parse_special = True
733735

llama_cpp/mtmd_cpp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,14 @@ class mtmd_pos_type(enum.IntEnum):
178178

179179
# struct mtmd_input_text {
180180
# const char * text;
181+
# size_t text_len;
181182
# bool add_special;
182183
# bool parse_special;
183184
# };
184185
class mtmd_input_text(Structure):
185186
_fields_ = [
186187
("text", c_char_p),
188+
("text_len", c_size_t),
187189
("add_special", c_bool),
188190
("parse_special", c_bool),
189191
]

vendor/llama.cpp

Submodule llama.cpp updated 126 files

0 commit comments

Comments
 (0)