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 e37a808 commit 7e55244Copy full SHA for 7e55244
llama_cpp/llama.py
@@ -295,6 +295,7 @@ 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
+ top_k = llama_cpp.c_int(n_vocab) if top_k.value <= 0 else top_k
299
logits = self.eval_logits[-1]
300
data = (llama_cpp.llama_token_data * n_vocab)(
301
*[
0 commit comments