Spaces:
Sleeping
Sleeping
Update emotional_core.py
Browse files- emotional_core.py +13 -2
emotional_core.py
CHANGED
|
@@ -1,6 +1,17 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
def render(online):
|
| 4 |
with gr.Column():
|
| 5 |
-
gr.Markdown("###
|
| 6 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import ethics_audit
|
| 3 |
+
|
| 4 |
+
def respond(msg, history):
|
| 5 |
+
ethics_audit.log_event("EmotionalCore interaction")
|
| 6 |
+
history = history or []
|
| 7 |
+
history.append((msg, "I'm here with you. Stay strong."))
|
| 8 |
+
return history, history
|
| 9 |
|
| 10 |
def render(online):
|
| 11 |
with gr.Column():
|
| 12 |
+
gr.Markdown("### Emotional Support Chatbot")
|
| 13 |
+
chatbot = gr.Chatbot()
|
| 14 |
+
msg = gr.Textbox(label="How are you feeling?")
|
| 15 |
+
submit = gr.Button("Send")
|
| 16 |
+
state = gr.State([])
|
| 17 |
+
submit.click(fn=respond, inputs=[msg, state], outputs=[chatbot, state])
|