Align dtype to match c structs

This commit is contained in:
Andrei Betlen 2023-05-26 22:02:16 -04:00
parent b0b154cfa6
commit 84e313bd6e

View file

@ -217,7 +217,7 @@ class Llama:
size = llama_cpp.c_size_t(self._n_vocab) size = llama_cpp.c_size_t(self._n_vocab)
sorted = llama_cpp.c_bool(False) sorted = llama_cpp.c_bool(False)
self._candidates_data = np.array( self._candidates_data = np.array(
[], dtype=[("id", np.intc), ("logit", np.single), ("p", np.single)] [], dtype=np.dtype([("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)
candidates = llama_cpp.llama_token_data_array( candidates = llama_cpp.llama_token_data_array(