commonlemon commited on
Commit
66d76cd
·
verified ·
1 Parent(s): 0216182

yes/no output

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,10 +1,11 @@
1
- import gradio as gr #abbreviate gradio, import lines go first
 
2
 
3
  def echo(message, history): #function for Gradio to call
4
  #Gradio passes arguments as parameters: the user's most recent input which is a string, i'm going to call it "message", and "history" which is the list of past messages
5
  #I have to put it in this order because Gradio will always past the current user input first and then the convo history
6
  # however for now, this chatbot won't use the history parameter anyay
7
- return message #returns what user types in
8
 
9
  # “I'm passing the function name 'echo' to ChatInterface, not 'echo()' with parentheses, because I want Gradio to call it later, not right now.”
10
 
 
1
+ import gradio as gr, random #abbreviate gradio, import lines go first
2
+
3
 
4
  def echo(message, history): #function for Gradio to call
5
  #Gradio passes arguments as parameters: the user's most recent input which is a string, i'm going to call it "message", and "history" which is the list of past messages
6
  #I have to put it in this order because Gradio will always past the current user input first and then the convo history
7
  # however for now, this chatbot won't use the history parameter anyay
8
+ return random.choice(["Yes", "No"]) #returns what user types in
9
 
10
  # “I'm passing the function name 'echo' to ChatInterface, not 'echo()' with parentheses, because I want Gradio to call it later, not right now.”
11