Y Phung Nguyen commited on
Commit
30bc748
·
1 Parent(s): c49474d

Enable thought demo mode

Browse files
Files changed (1) hide show
  1. ui.py +20 -20
ui.py CHANGED
@@ -140,24 +140,24 @@ def create_demo():
140
  label="Disable agentic reasoning",
141
  info="Use MedSwin model alone without agentic reasoning, RAG, or web search"
142
  )
143
- # show_agentic_thought = gr.Button(
144
- # "Show agentic thought",
145
- # size="sm"
146
- # )
147
  enable_clinical_intake = gr.Checkbox(
148
  value=True,
149
  label="Enable clinical intake (max 5 Q&A)",
150
  info="Ask focused follow-up questions before breaking down the case"
151
  )
152
- # agentic_thoughts_box = gr.Textbox(
153
- # label="Agentic Thoughts",
154
- # placeholder="Internal thoughts from MedSwin and supervisor will appear here...",
155
- # lines=8,
156
- # max_lines=15,
157
- # interactive=False,
158
- # visible=False,
159
- # elem_classes="agentic-thoughts"
160
- # )
161
  with gr.Row():
162
  use_rag = gr.Checkbox(
163
  value=False,
@@ -244,11 +244,11 @@ def create_demo():
244
  new_state = not current_state
245
  return gr.update(visible=new_state), new_state
246
 
247
- # show_agentic_thought.click(
248
- # fn=toggle_thoughts_box,
249
- # inputs=[show_thoughts_state],
250
- # outputs=[agentic_thoughts_box, show_thoughts_state]
251
- # )
252
 
253
  submit_button.click(
254
  fn=stream_chat,
@@ -270,7 +270,7 @@ def create_demo():
270
  disable_agentic_reasoning,
271
  show_thoughts_state
272
  ],
273
- outputs=[chatbot]#, agentic_thoughts_box]
274
  )
275
 
276
  message_input.submit(
@@ -293,7 +293,7 @@ def create_demo():
293
  disable_agentic_reasoning,
294
  show_thoughts_state
295
  ],
296
- outputs=[chatbot]#, agentic_thoughts_box]
297
  )
298
 
299
  return demo
 
140
  label="Disable agentic reasoning",
141
  info="Use MedSwin model alone without agentic reasoning, RAG, or web search"
142
  )
143
+ show_agentic_thought = gr.Button(
144
+ "Show agentic thought",
145
+ size="sm"
146
+ )
147
  enable_clinical_intake = gr.Checkbox(
148
  value=True,
149
  label="Enable clinical intake (max 5 Q&A)",
150
  info="Ask focused follow-up questions before breaking down the case"
151
  )
152
+ agentic_thoughts_box = gr.Textbox(
153
+ label="Agentic Thoughts",
154
+ placeholder="Internal thoughts from MedSwin and supervisor will appear here...",
155
+ lines=8,
156
+ max_lines=15,
157
+ interactive=False,
158
+ visible=False,
159
+ elem_classes="agentic-thoughts"
160
+ )
161
  with gr.Row():
162
  use_rag = gr.Checkbox(
163
  value=False,
 
244
  new_state = not current_state
245
  return gr.update(visible=new_state), new_state
246
 
247
+ show_agentic_thought.click(
248
+ fn=toggle_thoughts_box,
249
+ inputs=[show_thoughts_state],
250
+ outputs=[agentic_thoughts_box, show_thoughts_state]
251
+ )
252
 
253
  submit_button.click(
254
  fn=stream_chat,
 
270
  disable_agentic_reasoning,
271
  show_thoughts_state
272
  ],
273
+ outputs=[chatbot, agentic_thoughts_box]
274
  )
275
 
276
  message_input.submit(
 
293
  disable_agentic_reasoning,
294
  show_thoughts_state
295
  ],
296
+ outputs=[chatbot, agentic_thoughts_box]
297
  )
298
 
299
  return demo