We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 087cc0b commit 5cae104Copy full SHA for 5cae104
llama_cpp/llama.py
@@ -562,12 +562,12 @@ def eval(self, tokens: Sequence[int]):
562
if self.context_params.logits_all:
563
rows = n_tokens
564
cols = self._n_vocab
565
- logits = self._ctx.get_logits()[: rows * cols]
+ logits = np.ctypeslib.as_array(self._ctx.get_logits(), shape=(rows * cols, ))
566
self.scores[n_past : n_past + n_tokens, :].reshape(-1)[: :] = logits
567
else:
568
rows = 1
569
570
571
self.scores[n_past + n_tokens - 1, :].reshape(-1)[: :] = logits
572
# Update n_tokens
573
self.n_tokens += n_tokens
0 commit comments