nanova commited on
Commit
3f628a3
·
1 Parent(s): 1d461d7
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -87,16 +87,14 @@ def respond(
87
  except json.JSONDecodeError:
88
  continue
89
  if current_response:
90
- if '<think>' in current_response:
91
- current_response = current_response.replace('<think>', '<details open><summary>Thinking</summary>\n\n```')
92
- if '</think>' in current_response:
93
- current_response = current_response.replace('</think>', '```\n\n</details>')
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('<', '&lt;').replace('>', '&gt;')
99
- formatted_response = formatted_response.replace('&lt;details open&gt;', '<details open>')
100
  formatted_response = formatted_response.replace('&lt;/details&gt;', '</details>')
101
  formatted_response = formatted_response.replace('&lt;summary&gt;', '<summary>')
102
  formatted_response = formatted_response.replace('&lt;/summary&gt;', '</summary>')
 
87
  except json.JSONDecodeError:
88
  continue
89
  if current_response:
90
+ # 直接替换details open为details
91
+ current_response = current_response.replace('<details open>', '<details>')
 
 
92
  if '**Final Answer**' in current_response:
93
  current_response = current_response.replace('**Final Answer**', '')
94
 
95
  formatted_response = current_response
96
  formatted_response = formatted_response.replace('<', '&lt;').replace('>', '&gt;')
97
+ formatted_response = formatted_response.replace('&lt;details&gt;', '<details>')
98
  formatted_response = formatted_response.replace('&lt;/details&gt;', '</details>')
99
  formatted_response = formatted_response.replace('&lt;summary&gt;', '<summary>')
100
  formatted_response = formatted_response.replace('&lt;/summary&gt;', '</summary>')