Update app.py
Browse files
app.py
CHANGED
@@ -3,5 +3,15 @@ import gradio as gr
|
|
3 |
def greet(name):
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|