We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e55244 commit f11e2a7Copy full SHA for f11e2a7
llama_cpp/llama.py
@@ -295,7 +295,9 @@ def _sample(
295
assert self.ctx is not None
296
assert len(self.eval_logits) > 0
297
n_vocab = int(llama_cpp.llama_n_vocab(self.ctx))
298
+ n_ctx = int(llama_cpp.llama_n_ctx(self.ctx))
299
top_k = llama_cpp.c_int(n_vocab) if top_k.value <= 0 else top_k
300
+ last_n_tokens_size = llama_cpp.c_int(n_ctx) if last_n_tokens_size.value < 0 else last_n_tokens_size
301
logits = self.eval_logits[-1]
302
data = (llama_cpp.llama_token_data * n_vocab)(
303
*[
0 commit comments