update
Browse files
app.py
CHANGED
@@ -69,37 +69,29 @@ def respond(
|
|
69 |
|
70 |
if len(current_response) > 16:
|
71 |
if '<think>' in current_response:
|
72 |
-
current_response = current_response.replace('<think>', '
|
73 |
if '</think>' in current_response:
|
74 |
-
current_response = current_response.replace('</think>', '
|
75 |
if '**Final Answer**' in current_response:
|
76 |
current_response = current_response.replace('**Final Answer**', '')
|
77 |
|
78 |
formatted_response = current_response[:-16]
|
79 |
|
80 |
formatted_response = formatted_response.replace('<', '<').replace('>', '>')
|
81 |
-
formatted_response = formatted_response.replace('<details>', '<details>')
|
82 |
-
formatted_response = formatted_response.replace('</details>', '</details>')
|
83 |
-
formatted_response = formatted_response.replace('<summary>', '<summary>')
|
84 |
-
formatted_response = formatted_response.replace('</summary>', '</summary>')
|
85 |
formatted_response = formatted_response.replace('*', '\\*')
|
86 |
yield formatted_response
|
87 |
except json.JSONDecodeError:
|
88 |
continue
|
89 |
if current_response:
|
90 |
if '<think>' in current_response:
|
91 |
-
current_response = current_response.replace('<think>', '
|
92 |
if '</think>' in current_response:
|
93 |
-
current_response = current_response.replace('</think>', '
|
94 |
if '**Final Answer**' in current_response:
|
95 |
current_response = current_response.replace('**Final Answer**', '')
|
96 |
|
97 |
formatted_response = current_response
|
98 |
formatted_response = formatted_response.replace('<', '<').replace('>', '>')
|
99 |
-
formatted_response = formatted_response.replace('<details>', '<details>')
|
100 |
-
formatted_response = formatted_response.replace('</details>', '</details>')
|
101 |
-
formatted_response = formatted_response.replace('<summary>', '<summary>')
|
102 |
-
formatted_response = formatted_response.replace('</summary>', '</summary>')
|
103 |
formatted_response = formatted_response.replace('*', '\\*')
|
104 |
yield formatted_response
|
105 |
else:
|
|
|
69 |
|
70 |
if len(current_response) > 16:
|
71 |
if '<think>' in current_response:
|
72 |
+
current_response = current_response.replace('<think>', '> **Thinking...**\n> \n> ```')
|
73 |
if '</think>' in current_response:
|
74 |
+
current_response = current_response.replace('</think>', '```')
|
75 |
if '**Final Answer**' in current_response:
|
76 |
current_response = current_response.replace('**Final Answer**', '')
|
77 |
|
78 |
formatted_response = current_response[:-16]
|
79 |
|
80 |
formatted_response = formatted_response.replace('<', '<').replace('>', '>')
|
|
|
|
|
|
|
|
|
81 |
formatted_response = formatted_response.replace('*', '\\*')
|
82 |
yield formatted_response
|
83 |
except json.JSONDecodeError:
|
84 |
continue
|
85 |
if current_response:
|
86 |
if '<think>' in current_response:
|
87 |
+
current_response = current_response.replace('<think>', '> **Thinking...**\n> \n> ```')
|
88 |
if '</think>' in current_response:
|
89 |
+
current_response = current_response.replace('</think>', '```')
|
90 |
if '**Final Answer**' in current_response:
|
91 |
current_response = current_response.replace('**Final Answer**', '')
|
92 |
|
93 |
formatted_response = current_response
|
94 |
formatted_response = formatted_response.replace('<', '<').replace('>', '>')
|
|
|
|
|
|
|
|
|
95 |
formatted_response = formatted_response.replace('*', '\\*')
|
96 |
yield formatted_response
|
97 |
else:
|