Merge pull request #508 from ctejada85/main

Now the last token sent when `stream=True`
This commit is contained in:
Andrei 2023-07-20 16:07:54 -04:00 committed by GitHub
commit 5549a1cabd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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