Spaces:
Sleeping
Sleeping
Add Thumbs Up/Thumbs Down
Browse files
app.py
CHANGED
@@ -32,6 +32,12 @@ def respond(message, history):
|
|
32 |
response = vq.submit_query(message)
|
33 |
yield response
|
34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
heading_html = f'''
|
36 |
<table>
|
37 |
<tr>
|
@@ -86,6 +92,7 @@ with gr.Blocks(css=bot_css) as demo:
|
|
86 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
87 |
bot, chatbot, chatbot, api_name="bot_response"
|
88 |
)
|
|
|
89 |
|
90 |
clear.click(lambda: None, None, chatbot, queue=False)
|
91 |
|
|
|
32 |
response = vq.submit_query(message)
|
33 |
yield response
|
34 |
|
35 |
+
def vote(data: gr.LikeData):
|
36 |
+
if data.liked:
|
37 |
+
print("Received Thumbs up")
|
38 |
+
else:
|
39 |
+
print("Received Thumbs down")
|
40 |
+
|
41 |
heading_html = f'''
|
42 |
<table>
|
43 |
<tr>
|
|
|
92 |
msg.submit(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
93 |
bot, chatbot, chatbot, api_name="bot_response"
|
94 |
)
|
95 |
+
chatbot.like(vote, None, None)
|
96 |
|
97 |
clear.click(lambda: None, None, chatbot, queue=False)
|
98 |
|