Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,17 @@
|
|
1 |
-
import time
|
2 |
import gradio as gr
|
3 |
|
4 |
-
def
|
5 |
-
|
6 |
-
time.sleep(0.3)
|
7 |
-
yield "You typed: " + message[: i+1]
|
8 |
|
9 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def yes(message, history):
|
4 |
+
return "yes"
|
|
|
|
|
5 |
|
6 |
+
def vote(data: gr.LikeData):
|
7 |
+
if data.liked:
|
8 |
+
print("You upvoted this response: " + data.value["value"])
|
9 |
+
else:
|
10 |
+
print("You downvoted this response: " + data.value["value"])
|
11 |
+
|
12 |
+
with gr.Blocks() as demo:
|
13 |
+
chatbot = gr.Chatbot(placeholder="<strong>Your Personal Yes-Man</strong><br>Ask Me Anything")
|
14 |
+
chatbot.like(vote, None, None)
|
15 |
+
gr.ChatInterface(fn=yes, chatbot=chatbot)
|
16 |
+
|
17 |
+
demo.launch()
|