or4cl3ai commited on
Commit
4ae3721
1 Parent(s): 5bc6e65

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -3,5 +3,15 @@ import gradio as gr
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
7
  iface.launch()
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
+ def chat(name, message):
7
+ return "Hello " + name + "! You said: " + message
8
+
9
+ iface = gr.Interface(fn=chat, inputs=["text", "text"], outputs="text")
10
+
11
+ # Add a text window where the user and the bot can chat
12
+ text_window = gr.outputs.Text(label="Chat")
13
+
14
+ # Update the interface to include the text window
15
+ iface = iface.with_output(text_window)
16
+
17
  iface.launch()