From 8b4968ea673b9cb7a218712d4bf2c74703ac95b8 Mon Sep 17 00:00:00 2001 From: Andrei Betlen Date: Tue, 6 Jun 2023 11:37:57 -0400 Subject: [PATCH] Fix resize issue. Closes #330 --- llama_cpp/llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index 18372c8..2a96ff8 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -222,7 +222,7 @@ class Llama: [("id", np.intc), ("logit", np.single), ("p", np.single)], align=True ), ) - self._candidates_data.resize(3, self._n_vocab) + self._candidates_data.resize(3, self._n_vocab, refcheck=False) candidates = llama_cpp.llama_token_data_array( data=self._candidates_data.ctypes.data_as(llama_cpp.llama_token_data_p), size=size,