Saachi-S123 commited on
Commit
371d533
·
verified ·
1 Parent(s): e0d2a5d

added random.choices

Browse files
Files changed (1) hide show
  1. app.py +5 -17
app.py CHANGED
@@ -1,23 +1,11 @@
1
  import gradio as gr
2
  import random as rm
3
 
4
- def yes(message, history):
5
- return "yes"
 
6
 
7
- def no(message, history):
8
- return "yes"
9
-
10
- def rm(data: gr.LikeData):
11
- if data.liked:
12
- print("You upvoted this response: " + data.value["value"])
13
- else:
14
- print("You downvoted this response: " + data.value["value"])
15
-
16
- with gr.Blocks() as demo:
17
- chatbot = gr.Chatbot(placeholder="<strong>Your Personal Yes-Man</strong><br>Ask Me Anything")
18
- chatbot.like(vote, None, None)
19
- gr.ChatInterface(fn=yes, type="messages", chatbot=chatbot)
20
-
21
- demo.launch()
22
 
23
 
 
1
  import gradio as gr
2
  import random as rm
3
 
4
+ def respond_yes_or_no(message, history):
5
+ random.choices (["yes", "girl no"])
6
+ return random.choice (responces)
7
 
8
+ chatbot = gr.ChatInterface(respond_yes_or_no, type='meessages')
9
+ chatbot.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11