Skip to content

Commit f5c2f99

Browse files
committed
Format
1 parent d28b753 commit f5c2f99

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llama_cpp/llama.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,11 @@ def _sample(
298298
n_vocab = int(llama_cpp.llama_n_vocab(self.ctx))
299299
n_ctx = int(llama_cpp.llama_n_ctx(self.ctx))
300300
top_k = llama_cpp.c_int(n_vocab) if top_k.value <= 0 else top_k
301-
last_n_tokens_size = llama_cpp.c_int(n_ctx) if last_n_tokens_size.value < 0 else last_n_tokens_size
301+
last_n_tokens_size = (
302+
llama_cpp.c_int(n_ctx)
303+
if last_n_tokens_size.value < 0
304+
else last_n_tokens_size
305+
)
302306
logits = self.eval_logits[-1]
303307
nl_logit = logits[llama_cpp.llama_token_nl().value]
304308
data = (llama_cpp.llama_token_data * n_vocab)(

0 commit comments

Comments
 (0)