Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d40a250

Browse files
committed
feat: Use new llama_token_is_eog in create_completions
1 parent b21ba0e commit d40a250

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llama_cpp/llama.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,8 @@ def logit_bias_processor(
10341034
logits_processor=logits_processor,
10351035
grammar=grammar,
10361036
):
1037-
if token == self._token_eos:
1037+
assert self._model.model is not None
1038+
if llama_cpp.llama_token_is_eog(self._model.model, token):
10381039
text = self.detokenize(completion_tokens, prev_tokens=prompt_tokens)
10391040
finish_reason = "stop"
10401041
break

0 commit comments

Comments
 (0)