Rahatara commited on
Commit
7e2fc85
1 Parent(s): 780874d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -5
app.py CHANGED
@@ -136,7 +136,17 @@ questions = [
136
  "How can mindfulness help in managing emotions?",
137
  "What are some techniques to handle distressing situations?",
138
  "Can you explain the concept of radical acceptance?",
139
- "How does DBT differ from other types of therapy?"
 
 
 
 
 
 
 
 
 
 
140
  ]
141
 
142
  # Gradio interface
@@ -183,11 +193,23 @@ with gr.Blocks() as demo:
183
  inputs=[],
184
  outputs=[chatbot_current],
185
  )
186
-
187
- with gr.Tab("Questions"):
188
  gr.Markdown("### Example Questions")
189
- for question in questions:
190
- gr.Markdown(f"- {question}")
 
 
 
 
 
 
 
 
 
 
 
 
191
 
192
  demo.queue()
193
  demo.launch()
 
136
  "How can mindfulness help in managing emotions?",
137
  "What are some techniques to handle distressing situations?",
138
  "Can you explain the concept of radical acceptance?",
139
+ "How does DBT differ from other types of therapy?",
140
+ "What are the four modules of DBT?",
141
+ "How can DBT skills be applied in daily life?",
142
+ "What is the importance of emotional regulation in DBT?",
143
+ "How does DBT address interpersonal effectiveness?",
144
+ "What are some common myths about DBT?",
145
+ "How can one practice distress tolerance skills?",
146
+ "What role does validation play in DBT?",
147
+ "How does DBT incorporate cognitive-behavioral techniques?",
148
+ "What are the stages of DBT treatment?",
149
+ "How can one use DBT skills to improve self-awareness?"
150
  ]
151
 
152
  # Gradio interface
 
193
  inputs=[],
194
  outputs=[chatbot_current],
195
  )
196
+
197
+ with gr.Tab("Example Questions"):
198
  gr.Markdown("### Example Questions")
199
+ question_dropdown = gr.Dropdown(
200
+ label="Select a question",
201
+ choices=questions
202
+ )
203
+ question_submit_btn = gr.Button("Submit Question")
204
+
205
+ question_submit_btn.click(
206
+ fn=add_text,
207
+ inputs=[chatbot_current, question_dropdown],
208
+ outputs=[chatbot_current],
209
+ queue=False,
210
+ ).success(
211
+ fn=get_response_current, inputs=[chatbot_current, question_dropdown], outputs=[chatbot_current, source_texts_output_current]
212
+ )
213
 
214
  demo.queue()
215
  demo.launch()