vsrinivas commited on
Commit
91bab2f
1 Parent(s): 55acba8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -35,17 +35,20 @@ with gr.Blocks() as demo:
35
  chatbox = gr.Chatbot(label="Therapy Session Conversation",value =[[None, 'Therapist: Hello, What can I do for you?']], height=300)
36
  user_input = gr.Textbox(placeholder="Enter your message here...", label="User")
37
  submit_button = gr.Button("Submit")
38
- submit_button.click(ps.get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
39
- user_input.submit(ps.get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
 
 
40
  recommendations = gr.Textbox(label="Recommended Actions", visible = False)
41
 
42
  def summarize_and_recommend_process():
43
- sn, r = ps.summarize_and_recommend()
 
44
  return gr.update(visible=True, value=sn), gr.update(visible=True, value=r)
45
 
46
  process_button = gr.Button("Generate Session Notes & Recommendations")
47
  clear = gr.ClearButton(components=[user_input, chatbox, emotions, summary_notes, recommendations], value="Clear console")
48
- process_button.click(summarize_and_recommend_process, inputs=None, outputs=[summary_notes, recommendations])
49
 
50
 
51
  demo.launch(debug=True, share=True)
 
35
  chatbox = gr.Chatbot(label="Therapy Session Conversation",value =[[None, 'Therapist: Hello, What can I do for you?']], height=300)
36
  user_input = gr.Textbox(placeholder="Enter your message here...", label="User")
37
  submit_button = gr.Button("Submit")
38
+ submit_button.click(get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
39
+ user_input.submit(get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
40
+ # submit_button.click(ps.get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
41
+ # user_input.submit(ps.get_doc_response_emotions, [user_input, chatbox], [user_input, chatbox, emotions])
42
  recommendations = gr.Textbox(label="Recommended Actions", visible = False)
43
 
44
  def summarize_and_recommend_process():
45
+ # sn, r = ps.summarize_and_recommend()
46
+ sn, r = summarize_and_recommend()
47
  return gr.update(visible=True, value=sn), gr.update(visible=True, value=r)
48
 
49
  process_button = gr.Button("Generate Session Notes & Recommendations")
50
  clear = gr.ClearButton(components=[user_input, chatbox, emotions, summary_notes, recommendations], value="Clear console")
51
+ process_button.click(summarize_and_recommend_process, inputs=chatbox, outputs=[summary_notes, recommendations])
52
 
53
 
54
  demo.launch(debug=True, share=True)