Skip to content

Commit 7664a3e

Browse files
authored
feat: Update llama.cpp to ggml-org/llama.cpp@91e84fed6 (abetlen#2218)
* feat: update llama.cpp to 91e84fed6 * chore: document mtmd_caps c declaration
1 parent 95ccb19 commit 7664a3e

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- feat: Update llama.cpp to ggerganov/llama.cpp@91e84fed6 and sync Python bindings
1011
- fix: Enable unified KV cache for embedding contexts to preserve full per-sequence context in batch embedding calls by @SanjanaB123 in #2217
1112

1213
## [0.3.23]

llama_cpp/llama_cpp.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2837,6 +2837,9 @@ def llama_state_seq_load_file(
28372837
) -> int: ...
28382838

28392839

2840+
# define LLAMA_STATE_SEQ_FLAGS_NONE 0
2841+
LLAMA_STATE_SEQ_FLAGS_NONE = 0
2842+
28402843
# for backwards-compat
28412844
# define LLAMA_STATE_SEQ_FLAGS_SWA_ONLY 1
28422845
LLAMA_STATE_SEQ_FLAGS_SWA_ONLY = 1

llama_cpp/mtmd_cpp.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,23 @@ class mtmd_decoder_pos(Structure):
134134
]
135135

136136

137+
# struct mtmd_caps {
138+
# bool inp_vision;
139+
# bool inp_audio;
140+
# };
141+
class mtmd_caps(Structure):
142+
"""Capabilities exposed by an mmproj file."""
143+
144+
if TYPE_CHECKING:
145+
inp_vision: bool
146+
inp_audio: bool
147+
148+
_fields_ = [
149+
("inp_vision", c_bool),
150+
("inp_audio", c_bool),
151+
]
152+
153+
137154
################################################
138155
# mtmd.h functions
139156
################################################
@@ -515,6 +532,13 @@ def mtmd_get_output_embd(ctx: mtmd_context_p, /) -> Optional[CtypesArray[c_float
515532
...
516533

517534

535+
# MTMD_API struct mtmd_caps mtmd_get_cap_from_file(const char * mmproj_fname);
536+
@ctypes_function("mtmd_get_cap_from_file", [c_char_p], mtmd_caps)
537+
def mtmd_get_cap_from_file(mmproj_fname: bytes, /) -> mtmd_caps:
538+
"""Get mmproj capabilities without initializing a full MTMD context."""
539+
...
540+
541+
518542
# MTMD_API mtmd_input_chunks * mtmd_test_create_input_chunks(void);
519543
@ctypes_function("mtmd_test_create_input_chunks", [], mtmd_input_chunks_p_ctypes)
520544
def mtmd_test_create_input_chunks() -> Optional[mtmd_input_chunks_p]:

vendor/llama.cpp

0 commit comments

Comments
 (0)