Skip to content

Commit e3b7ad6

Browse files
committed
Update Submodule vendor/llama.cpp 037bfe3..81df3f7
1 parent 15f8a36 commit e3b7ad6

2 files changed

Lines changed: 11 additions & 9 deletions

File tree

llama_cpp/mtmd_cpp.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -587,17 +587,17 @@ class mtmd_decoder_pos(Structure):
587587

588588
# // get position for decoder attention, to be used by M-RoPE models
589589
# // i is the index of the embedding token, ranging from 0 to mtmd_image_tokens_get_n_tokens() - 1
590-
# // return relative position (for example, embedding 0 will have position (0, 0, 0);
591-
# // remember to adjust it to the current absolute position)
592-
# MTMD_API struct mtmd_decoder_pos mtmd_image_tokens_get_decoder_pos(const mtmd_image_tokens * image_tokens, size_t i);
590+
# // pos_0 is the absolute position of the first token
591+
# // return relative position (for example, embedding 0 will have position (0, 0, 0); remember to adjust it to the current absolute position)
592+
# MTMD_API struct mtmd_decoder_pos mtmd_image_tokens_get_decoder_pos(const mtmd_image_tokens * image_tokens, llama_pos pos_0, size_t i);
593593
@ctypes_function_mtmd(
594-
"mtmd_image_tokens_get_decoder_pos", [mtmd_image_tokens_p_ctypes, c_size_t], mtmd_decoder_pos)
595-
def mtmd_image_tokens_get_decoder_pos(image_tokens: mtmd_image_tokens_p, i: c_size_t) -> mtmd_decoder_pos:
594+
"mtmd_image_tokens_get_decoder_pos", [mtmd_image_tokens_p_ctypes, c_int32, c_size_t], mtmd_decoder_pos)
595+
def mtmd_image_tokens_get_decoder_pos(image_tokens: mtmd_image_tokens_p, pos_0: c_int32, i: c_size_t) -> mtmd_decoder_pos:
596596
"""
597597
get position for decoder attention, to be used by M-RoPE models
598598
i is the index of the embedding token, ranging from 0 to mtmd_image_tokens_get_n_tokens() - 1
599-
return relative position (for example, embedding 0 will have position (0, 0, 0);
600-
remember to adjust it to the current absolute position)
599+
pos_0 is the absolute position of the first token
600+
return relative position (for example, embedding 0 will have position (0, 0, 0); remember to adjust it to the current absolute position)
601601
"""
602602
...
603603

@@ -815,14 +815,16 @@ def mtmd_helper_get_n_pos(chunks: mtmd_input_chunk_p) -> c_int32:
815815

816816
# // helper to get the list of relative positions corresponding to the embedding tokens, to be used by M-RoPE
817817
# // out_pos must have length == mtmd_helper_get_n_tokens(image)
818-
# MTMD_API void mtmd_helper_image_get_decoder_pos(const mtmd_image_tokens * image, struct mtmd_decoder_pos * out_pos);
818+
# MTMD_API void mtmd_helper_image_get_decoder_pos(const mtmd_image_tokens * image, llama_pos pos_0, struct mtmd_decoder_pos * out_pos);
819819
@ctypes_function_mtmd("mtmd_helper_image_get_decoder_pos", [
820820
mtmd_image_tokens_p_ctypes,
821+
c_int32,
821822
mtmd_decoder_pos_p_ctypes
822823
],
823824
None)
824825
def mtmd_helper_image_get_decoder_pos(
825826
image: mtmd_image_tokens_p,
827+
pos_0: c_int32,
826828
out_pos: mtmd_decoder_pos_p # type: ignore
827829
) -> c_int32:
828830
"""

vendor/llama.cpp

0 commit comments

Comments
 (0)