Skip to content

Commit dbfc1cf

Browse files
committed
Correct llama_kv_cache_clear function with llama_memory_clear function
1 parent 0701c73 commit dbfc1cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llama_cpp/llama.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ def embed(
10861086
data: Union[List[List[float]], List[List[List[float]]]] = []
10871087

10881088
def decode_batch(seq_sizes: List[int]):
1089-
llama_cpp.llama_kv_cache_clear(self._ctx.ctx)
1089+
llama_cpp.llama_memory_clear(llama_cpp.llama_get_memory(self._ctx.ctx), True)
10901090
self._ctx.decode(self._batch)
10911091
self._batch.reset()
10921092

@@ -1157,7 +1157,7 @@ def decode_batch(seq_sizes: List[int]):
11571157

11581158
output = data[0] if isinstance(input, str) else data
11591159

1160-
llama_cpp.llama_kv_cache_clear(self._ctx.ctx)
1160+
llama_cpp.llama_memory_clear(llama_cpp.llama_get_memory(self._ctx.ctx), True)
11611161
self.reset()
11621162

11631163
if return_count:

0 commit comments

Comments
 (0)