Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f11e2a7

Browse filesBrowse files
committed
Fix last_n_tokens_size
1 parent 7e55244 commit f11e2a7
Copy full SHA for f11e2a7

File tree

Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-0
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,9 @@ def _sample(
295295
assert self.ctx is not None
296296
assert len(self.eval_logits) > 0
297297
n_vocab = int(llama_cpp.llama_n_vocab(self.ctx))
298+
n_ctx = int(llama_cpp.llama_n_ctx(self.ctx))
298299
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
299301
logits = self.eval_logits[-1]
300302
data = (llama_cpp.llama_token_data * n_vocab)(
301303
*[

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.