Skip to content

Commit 5549a1c

Browse files
authored
Merge pull request #508 from ctejada85/main
Now the last token sent when `stream=True`
2 parents 3687262 + 0756a2d commit 5549a1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llama_cpp/llama.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def _create_completion(
953953
token_end_position += len(self.detokenize([token]))
954954
# Check if stop sequence is in the token
955955
if token_end_position >= (
956-
remaining_length - first_stop_position - 1
956+
remaining_length - first_stop_position
957957
):
958958
break
959959
logprobs_or_none: Optional[CompletionLogprobs] = None

0 commit comments

Comments
 (0)