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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- fix(example): retain recurrent state for server MTP rollback
- feat: update llama.cpp to ggml-org/llama.cpp@adb55e514
- fix(server): show falsey defaults in CLI help by @cupkk in #2355
- fix: release multimodal contexts when closing Llama by @Anai-Guo in #2343

## [0.3.34]

Expand Down
7 changes: 2 additions & 5 deletions llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import string

from datetime import datetime
from contextlib import ExitStack
from typing import (
Any,
Dict,
Expand Down Expand Up @@ -2779,7 +2778,6 @@ def __init__(self, clip_model_path: str, verbose: bool = True):
self.clip_model_path = clip_model_path
self.verbose = verbose
self._mtmd_cpp = mtmd_cpp
self._exit_stack = ExitStack()
self.mtmd_ctx: Optional[mtmd_cpp.mtmd_context_p] = None

if not os.path.exists(clip_model_path):
Expand Down Expand Up @@ -2825,7 +2823,7 @@ def mtmd_free():
self._mtmd_cpp.mtmd_free(self.mtmd_ctx)
self.mtmd_ctx = None

self._exit_stack.callback(mtmd_free)
llama_model._stack.callback(mtmd_free)

def load_image(self, image_url: str) -> bytes:
return self._load_image(image_url)
Expand Down Expand Up @@ -3278,7 +3276,6 @@ def __init__(
self.verbose = verbose
self.use_gpu = use_gpu
self._mtmd_cpp = mtmd_cpp
self._exit_stack = ExitStack()
self.mtmd_ctx: Optional[mtmd_cpp.mtmd_context_p] = None

if not os.path.exists(clip_model_path):
Expand Down Expand Up @@ -3321,7 +3318,7 @@ def mtmd_free():
self._mtmd_cpp.mtmd_free(self.mtmd_ctx)
self.mtmd_ctx = None

self._exit_stack.callback(mtmd_free)
llama_model._stack.callback(mtmd_free)

def load_image(self, image_url: str) -> bytes:
return self._load_image(image_url)
Expand Down