sjdata commited on
Commit
411466e
1 Parent(s): 66d1035

Fixed application file

Browse files
Files changed (1) hide show
  1. app.py +6 -17
app.py CHANGED
@@ -1,21 +1,10 @@
 
1
  import gradio as gr
2
 
3
- def yes_man(message, history):
4
- if messages.endswith("?"):
5
- return "Yes"
6
  else:
7
- return "Ask me anything!"
8
 
9
- gr.ChatInterface(
10
- yes_man,
11
- chatbot=gr.Chatbot(height=300),
12
- textbox=gr.Textbox(placeholder="Ask me a yes or no question"),
13
- title="Yes Man",
14
- description="Ask Yes Man any question",
15
- theme="soft",
16
- examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
17
- cache_examples=True,
18
- retry_btn=None,
19
- undo_btn="Delete Previous",
20
- clear_btn="Clear",
21
- ).launch()
 
1
+ import random
2
  import gradio as gr
3
 
4
+ def alternatingly_agree(message, history):
5
+ if len(history) % 2 == 0:
6
+ return f"Yes, I do think that '{message}'"
7
  else:
8
+ return "I don't think so"
9
 
10
+ gr.ChatInterface(alternatingly_agree).launch()