From 0756a2d3fbeabbfe998ecf50bf23663f46f7d819 Mon Sep 17 00:00:00 2001 From: Carlos Tejada Date: Wed, 19 Jul 2023 22:47:14 -0400 Subject: [PATCH] Now the last token sent when `stream=True` --- llama_cpp/llama.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index 92ca67d..3704287 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -953,7 +953,7 @@ class Llama: token_end_position += len(self.detokenize([token])) # Check if stop sequence is in the token if token_end_position >= ( - remaining_length - first_stop_position - 1 + remaining_length - first_stop_position ): break logprobs_or_none: Optional[CompletionLogprobs] = None