ritikaaA commited on
Commit
1e3ff24
·
verified ·
1 Parent(s): 8adf9a6

Coded yes_or_no function

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,12 +1,15 @@
1
  import gradio as gr
 
2
  # import lines go at the top! Any libraries I need to import go up ^
3
 
4
- # always need two parameters in hf
5
- print("hello world")
6
- def echo(message, type="messages"):
7
- return message
8
 
9
- chatbot = gr.ChatInterface(echo)
 
 
 
 
10
  # declaring chatbot so that user can interact and see their conversation history and send new messages
11
 
12
  chatbot.launch()
 
1
  import gradio as gr
2
+ import random
3
  # import lines go at the top! Any libraries I need to import go up ^
4
 
5
+ def yes_or_no(message, history):
6
+ return random.choice(['Yes','No'])
 
 
7
 
8
+ # always need two parameters in hf
9
+ # def echo(message, history):
10
+ # return message
11
+ print("hello world")
12
+ chatbot = gr.ChatInterface(yes_or_no, type="messages")
13
  # declaring chatbot so that user can interact and see their conversation history and send new messages
14
 
15
  chatbot.launch()