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 6e0642c

Browse filesBrowse files
authored
fix: fix logprobs when BOS is not present (abetlen#1471)
* Fix lobprobs when BOS is not present * Fix logprobs when bos is not available
1 parent 027f7bc commit 6e0642c
Copy full SHA for 6e0642c

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1410,8 +1410,8 @@ def logit_bias_processor(
14101410
top_logprobs: List[Optional[Dict[str, float]]] = []
14111411

14121412
if echo:
1413-
# Remove leading BOS token
1414-
all_tokens = prompt_tokens[1:] + completion_tokens
1413+
# Remove leading BOS token if exists
1414+
all_tokens = prompt_tokens[1 if prompt_tokens[0] == self.token_bos() else 0:] + completion_tokens
14151415
else:
14161416
all_tokens = completion_tokens
14171417

0 commit comments

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