Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,37 +23,40 @@ politely inform them that you are tuned to only answer questions about mental he
|
|
23 |
# history.append((inp, output))
|
24 |
# return history
|
25 |
|
26 |
-
|
27 |
|
28 |
-
gr.HTML("<center><h2>Omdena AI Chatbot For Mental Health and Well Being</h2></center>")
|
29 |
|
30 |
gr.HTML("WELCOME<br>"
|
31 |
"I am an AI ChatBot and I am here to assist you with whatever is bothering you. "
|
32 |
"Our conversation is strictly confidential and I will not remember it when you come back another time."
|
33 |
)
|
34 |
-
chatbot = gr.Chatbot()
|
35 |
-
message = gr.Textbox(label="What would you like to chat about?")
|
36 |
-
|
37 |
-
submit = gr.Button(value="Send")
|
38 |
-
clear = gr.Button(value="Clear Chat")
|
39 |
-
|
40 |
-
""" gr.Examples(
|
41 |
-
examples=[
|
42 |
-
"I feel lonely",
|
43 |
-
"I'm having problems at home",
|
44 |
-
"I am looking for some resources",
|
45 |
-
],
|
46 |
-
inputs=message,
|
47 |
-
)
|
48 |
"""
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
|
54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
-
clear.click(lambda: None, None, chatbot, queue=False)
|
57 |
|
58 |
if __name__ == "__main__":
|
59 |
demo.launch(debug=True)
|
|
|
23 |
# history.append((inp, output))
|
24 |
# return history
|
25 |
|
26 |
+
|
27 |
|
28 |
+
""" gr.HTML("<center><h2>Omdena AI Chatbot For Mental Health and Well Being</h2></center>")
|
29 |
|
30 |
gr.HTML("WELCOME<br>"
|
31 |
"I am an AI ChatBot and I am here to assist you with whatever is bothering you. "
|
32 |
"Our conversation is strictly confidential and I will not remember it when you come back another time."
|
33 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
"""
|
35 |
+
with gr.Blocks(theme=gr.themes.Glass()) as demo:
|
36 |
+
title="Omdena AI Chatbot for Mental Health and Wellbeing"
|
37 |
+
description="description"
|
38 |
+
chatbot = gr.Chatbot()
|
39 |
+
message = gr.Textbox(label="What would you like to chat about?")
|
40 |
+
response = gr.Textbox
|
41 |
+
|
42 |
+
def respond(message, chat_history):
|
43 |
+
response = "Tell me more about that"
|
44 |
+
chat_history.append((message, response))
|
45 |
+
return "", chat_history
|
46 |
+
|
47 |
+
with gr.Row():
|
48 |
+
send = gr.Button(value="Send").style(full_width=False)
|
49 |
+
clear = gr.Button(value="Clear Chat").style(full_width=False)
|
50 |
|
51 |
+
examples=[
|
52 |
+
["I feel lonely"],
|
53 |
+
["I'm having problems at home"],
|
54 |
+
["I am looking for some resources"],
|
55 |
+
]
|
56 |
+
|
57 |
+
send.click(respond, [message, chatbot], [message, chatbot])
|
58 |
+
clear.click(lambda: None, None, chatbot, queue=False)
|
59 |
|
|
|
60 |
|
61 |
if __name__ == "__main__":
|
62 |
demo.launch(debug=True)
|