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 9992c50

Browse filesBrowse files
committed
fix: Fix speculative decoding
1 parent 65222bc commit 9992c50
Copy full SHA for 9992c50

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,8 +807,10 @@ def sample(
807807
grammar=grammar,
808808
)
809809

810+
ridx = idx - self.n_tokens if idx is not None else -1
811+
810812
assert self.ctx is not None
811-
token = self._sampler.sample(self._ctx, -1)
813+
token = self._sampler.sample(self._ctx, ridx)
812814
if tmp_sampler:
813815
self._sampler = None
814816
return token

0 commit comments

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