Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -280,7 +280,9 @@ def simple_chat(message, temperature: float = 0.8, max_length: int = 4096, top_p
|
|
280 |
# formatted_text = buffer
|
281 |
|
282 |
try:
|
|
|
283 |
buffer = buffer.strip('`')
|
|
|
284 |
json_content = json.loads(buffer)
|
285 |
formatted_text = format_json_to_string(json_content)
|
286 |
except json.JSONDecodeError:
|
|
|
280 |
# formatted_text = buffer
|
281 |
|
282 |
try:
|
283 |
+
buffer = buffer.strip()
|
284 |
buffer = buffer.strip('`')
|
285 |
+
buffer = buffer.strip('json')
|
286 |
json_content = json.loads(buffer)
|
287 |
formatted_text = format_json_to_string(json_content)
|
288 |
except json.JSONDecodeError:
|