update
Browse files
app.py
CHANGED
@@ -65,15 +65,13 @@ def respond(
|
|
65 |
if 'content' in delta:
|
66 |
content = delta['content']
|
67 |
if content:
|
68 |
-
# content = content.replace('<', '<').replace('>', '>')
|
69 |
-
# content = content.replace('*', '\\*')
|
70 |
current_response += content
|
71 |
-
# yield current_response
|
72 |
formatted_response = current_response
|
73 |
if '<think>' in formatted_response and '</think>' in formatted_response:
|
74 |
-
formatted_response = formatted_response.replace('<think>', '
|
75 |
-
formatted_response = formatted_response.replace('</think>', '')
|
76 |
-
|
|
|
77 |
yield formatted_response
|
78 |
except json.JSONDecodeError:
|
79 |
continue
|
|
|
65 |
if 'content' in delta:
|
66 |
content = delta['content']
|
67 |
if content:
|
|
|
|
|
68 |
current_response += content
|
|
|
69 |
formatted_response = current_response
|
70 |
if '<think>' in formatted_response and '</think>' in formatted_response:
|
71 |
+
formatted_response = formatted_response.replace('<think>', '```\n')
|
72 |
+
formatted_response = formatted_response.replace('</think>', '\n```')
|
73 |
+
formatted_response = formatted_response.replace('<', '<').replace('>', '>')
|
74 |
+
formatted_response = formatted_response.replace('*', '\\*')
|
75 |
yield formatted_response
|
76 |
except json.JSONDecodeError:
|
77 |
continue
|