From 9c8f4dca5f5b46612a8006e2a43ad66973d18d11 Mon Sep 17 00:00:00 2001 From: Marko Tasic Date: Wed, 1 Nov 2023 23:52:50 +0100 Subject: [PATCH] fixed Llama._create_completion suffix check, it can be either None or str instance (#854) --- llama_cpp/llama.py | 1 + 1 file changed, 1 insertion(+) diff --git a/llama_cpp/llama.py b/llama_cpp/llama.py index e53c9c8..fb2a541 100644 --- a/llama_cpp/llama.py +++ b/llama_cpp/llama.py @@ -921,6 +921,7 @@ class Llama: 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())