giannicrivello commited on
Commit
4114ece
·
1 Parent(s): 7abf4f0

test chat bot

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -1,7 +1,22 @@
1
  import gradio as gr
2
 
3
- def test(input: str):
4
- return "Hello, " + input
5
 
6
- demo = gr.Interface(fn=test, inputs="text", outputs="text")
7
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
 
 
3
 
4
+ def yes_man(message, history):
5
+ if message.endswith("?"):
6
+ return "Yes"
7
+ else:
8
+ return "Ask me anything!"
9
+
10
+ gr.ChatInterface(
11
+ yes_man,
12
+ chatbot=gr.Chatbot(height=300),
13
+ textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
14
+ title="Yes Man",
15
+ description="Ask Yes Man any question",
16
+ theme="soft",
17
+ examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
18
+ cache_examples=True,
19
+ retry_btn=None,
20
+ undo_btn="Delete Previous",
21
+ clear_btn="Clear",
22
+ ).launch()