Skip to content

Commit 509b6a4

Browse files
committed
fix: handle non-terminating ``` in LLM output better
1 parent e85baaa commit 509b6a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gptme/llm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def print_clear():
104104
sys.stdout.flush()
105105
# pause inference on finished code-block, letting user run the command before continuing
106106
codeblock_started = "```" in delta_str[:-3]
107-
codeblock_finished = "```" in delta_str[-5:]
107+
codeblock_finished = "\n```\n" in delta_str[-7:]
108108
if codeblock_started and codeblock_finished:
109109
# noreorder
110110
from .tools import is_supported_codeblock # fmt: skip

0 commit comments

Comments
 (0)