From 474474d062ed0641efc9253c49a13631a5d57576 Mon Sep 17 00:00:00 2001 From: Marko Tasic Date: Mon, 30 Oct 2023 18:44:26 +0100 Subject: [PATCH] fixed Llama._create_completion suffix check, it can be either None or str instance --- llama_cpp/llama.py | 1 + 1 file changed, 1 insertion(+) diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index e53c9c8ae..fb2a54114 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -921,6 +921,7 @@ def _create_completion( grammar: Optional[LlamaGrammar] = None, ) -> Union[Iterator[Completion], Iterator[CompletionChunk]]: assert self.ctx is not None + assert suffix is None or suffix.__class__ is str completion_id: str = f"cmpl-{str(uuid.uuid4())}" created: int = int(time.time())