Spaces:
Running
Running
Update Gradio_UI.py
Browse files- 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 |
-
|
127 |
-
|
128 |
-
|
|
|
|
|
|
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 |
+
|