Skip to content

Commit

Permalink
fix: handle non-terminating ``` in LLM output better
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Nov 2, 2023
1 parent e85baaa commit 509b6a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gptme/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def print_clear():
sys.stdout.flush()
# pause inference on finished code-block, letting user run the command before continuing
codeblock_started = "```" in delta_str[:-3]
codeblock_finished = "```" in delta_str[-5:]
codeblock_finished = "\n```\n" in delta_str[-7:]
if codeblock_started and codeblock_finished:
# noreorder
from .tools import is_supported_codeblock # fmt: skip
Expand Down

0 comments on commit 509b6a4

Please sign in to comment.