Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- feat: update llama.cpp to ggml-org/llama.cpp@5a69c9743
- feat: update llama.cpp to ggml-org/llama.cpp@465b1f0e7
- feat(example): Updated server example (batch processing, multi-token prediction, `/v1/responses` api, response parsing) by @abetlen in #2174

## [0.3.26]
Expand Down
1 change: 1 addition & 0 deletions examples/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10102,6 +10102,7 @@ def _create_bitmap(self, media_bytes: bytes, kind: Literal["image", "audio"]) ->
self.ctx,
buffer,
len(media_bytes),
False,
)
if bitmap is None:
raise CompletionRequestValidationError(f"failed to create MTMD {kind} bitmap")
Expand Down
2 changes: 2 additions & 0 deletions llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -2841,6 +2841,7 @@ def _create_bitmap_from_bytes(self, image_bytes: bytes):
self.mtmd_ctx,
(ctypes.c_uint8 * len(image_bytes)).from_buffer(bytearray(image_bytes)),
len(image_bytes),
False,
)

if bitmap is None:
Expand Down Expand Up @@ -3332,6 +3333,7 @@ def _create_bitmap_from_bytes(self, image_bytes: bytes):
self.mtmd_ctx,
(ctypes.c_uint8 * len(image_bytes)).from_buffer(bytearray(image_bytes)),
len(image_bytes),
False,
)

if bitmap is None:
Expand Down
11 changes: 6 additions & 5 deletions llama_cpp/mtmd_cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,29 +551,30 @@ def mtmd_test_create_input_chunks() -> Optional[mtmd_input_chunks_p]:
################################################


# MTMD_API mtmd_bitmap * mtmd_helper_bitmap_init_from_file(mtmd_context * ctx, const char * fname);
# MTMD_API mtmd_bitmap * mtmd_helper_bitmap_init_from_file(mtmd_context * ctx, const char * fname, bool placeholder);
@ctypes_function(
"mtmd_helper_bitmap_init_from_file",
[mtmd_context_p_ctypes, c_char_p],
[mtmd_context_p_ctypes, c_char_p, c_bool],
mtmd_bitmap_p_ctypes,
)
def mtmd_helper_bitmap_init_from_file(
ctx: mtmd_context_p, fname: bytes, /
ctx: mtmd_context_p, fname: bytes, placeholder: Union[c_bool, bool], /
) -> Optional[mtmd_bitmap_p]:
"""Initialize an MTMD bitmap from a file."""
...


# MTMD_API mtmd_bitmap * mtmd_helper_bitmap_init_from_buf(mtmd_context * ctx, const unsigned char * buf, size_t len);
# MTMD_API mtmd_bitmap * mtmd_helper_bitmap_init_from_buf(mtmd_context * ctx, const unsigned char * buf, size_t len, bool placeholder);
@ctypes_function(
"mtmd_helper_bitmap_init_from_buf",
[mtmd_context_p_ctypes, POINTER(c_uint8), c_size_t],
[mtmd_context_p_ctypes, POINTER(c_uint8), c_size_t, c_bool],
mtmd_bitmap_p_ctypes,
)
def mtmd_helper_bitmap_init_from_buf(
ctx: mtmd_context_p,
buf: CtypesArray[c_uint8],
length: Union[c_size_t, int],
placeholder: Union[c_bool, bool],
/,
) -> Optional[mtmd_bitmap_p]: ...

Expand Down
Loading