Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -16,8 +16,9 @@ CSS = """.duplicate-button { margin: auto !important; color: white !important; b
|
|
16 |
def model_to_user_format(response):
|
17 |
"""Convert model format (with reasoning tags) to user format (with markdown)"""
|
18 |
if "<|end_reasoning|>" in response:
|
19 |
-
# Split at
|
20 |
-
reasoning
|
|
|
21 |
# Remove start reasoning tag if present
|
22 |
reasoning = reasoning.replace("<|start_reasoning|>", "").strip()
|
23 |
# Format in markdown
|
|
|
16 |
def model_to_user_format(response):
|
17 |
"""Convert model format (with reasoning tags) to user format (with markdown)"""
|
18 |
if "<|end_reasoning|>" in response:
|
19 |
+
parts = response.split("<|end_reasoning|>", 1) # Split at most once
|
20 |
+
reasoning = parts[0]
|
21 |
+
content = parts[1] if len(parts) > 1 else "" # Handle case if no split occurred
|
22 |
# Remove start reasoning tag if present
|
23 |
reasoning = reasoning.replace("<|start_reasoning|>", "").strip()
|
24 |
# Format in markdown
|