Tbaberca commited on
Commit
e48f73e
·
verified ·
1 Parent(s): 52f3c67

Update Gradio_UI.py

Browse files
Files changed (1) hide show
  1. Gradio_UI.py +5 -3
Gradio_UI.py CHANGED
@@ -123,6 +123,8 @@ def pull_messages_from_step(step_log: MemoryStep):
123
  content = str(args.get("answer", str(args))) if isinstance(args, dict) else str(args).strip()
124
 
125
  if used_code:
126
- content = re.sub(r"```.*?\n", "", content)
127
- content = re.sub(r"\s*<end_code>\s*", "", content).strip()
128
- if not content.startswith("```python"):
 
 
 
123
  content = str(args.get("answer", str(args))) if isinstance(args, dict) else str(args).strip()
124
 
125
  if used_code:
126
+ content = re.sub(r"```.*?\n", "", content)
127
+ content = re.sub(r"\s*<end_code>\s*", "", content).strip()
128
+ if not content.startswith("```python"):
129
+ content = f"```python\n{content}\n```"
130
+