nanova commited on
Commit
ca3b73e
·
1 Parent(s): 89253fd
Files changed (1) hide show
  1. app.py +10 -15
app.py CHANGED
@@ -88,7 +88,7 @@ def respond(
88
  continue
89
  if current_response:
90
  if '<think>' in current_response:
91
- current_response = current_response.replace('<think>', '<details><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:
@@ -96,7 +96,7 @@ def respond(
96
 
97
  formatted_response = current_response
98
  formatted_response = formatted_response.replace('<', '&lt;').replace('>', '&gt;')
99
- formatted_response = formatted_response.replace('&lt;details&gt;', '<details>')
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>')
@@ -151,22 +151,17 @@ demo = gr.ChatInterface(
151
  .prose p {
152
  margin-top: 1.5em !important;
153
  }
154
- .prose details {
155
- margin: 1em 0 !important;
156
- border: 1px solid #e5e7eb !important;
157
- border-radius: 6px !important;
158
  }
159
- .prose details summary {
160
- padding: 0.5em 1em !important;
161
- background: #f9fafb !important;
162
  cursor: pointer !important;
163
- border-radius: 6px 6px 0 0 !important;
164
  }
165
- .prose details summary:hover {
166
- background: #f3f4f6 !important;
167
- }
168
- .prose details[open] summary {
169
- border-bottom: 1px solid #e5e7eb !important;
170
  }
171
  """
172
  )
 
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:
 
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>')
 
151
  .prose p {
152
  margin-top: 1.5em !important;
153
  }
154
+ .accordion {
155
+ margin: 0 !important;
156
+ border: none !important;
 
157
  }
158
+ .accordion-header {
159
+ background: #f0f0f0 !important;
160
+ padding: 8px !important;
161
  cursor: pointer !important;
 
162
  }
163
+ .accordion-content {
164
+ padding: 8px !important;
 
 
 
165
  }
166
  """
167
  )