We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 027f7bc commit 6e0642cCopy full SHA for 6e0642c
llama_cpp/llama.py
@@ -1410,8 +1410,8 @@ def logit_bias_processor(
1410
top_logprobs: List[Optional[Dict[str, float]]] = []
1411
1412
if echo:
1413
- # Remove leading BOS token
1414
- all_tokens = prompt_tokens[1:] + completion_tokens
+ # Remove leading BOS token if exists
+ all_tokens = prompt_tokens[1 if prompt_tokens[0] == self.token_bos() else 0:] + completion_tokens
1415
else:
1416
all_tokens = completion_tokens
1417
0 commit comments