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 d6be533

Browse filesBrowse files
lapp0Andrew Lappabetlen
authored
fix: sample idx off-by-one error for logit_processors (abetlen#1179)
* fix sample_idx off-by-one error * self._scores is indexed differently, only modify the index within self._input_ids --------- Co-authored-by: Andrew Lapp <andrew@rew.la> Co-authored-by: Andrei <abetlen@gmail.com>
1 parent f7cdf78 commit d6be533
Copy full SHA for d6be533

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+1
-1
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def sample(
557557
logits[:] = (
558558
logits_processor(self._input_ids, logits)
559559
if idx is None
560-
else logits_processor(self._input_ids[:idx], logits)
560+
else logits_processor(self._input_ids[:idx + 1], logits)
561561
)
562562

563563
sampling_params = _LlamaSamplingParams(

0 commit comments

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