import gradio as gr | |
def greet(name): | |
return "Hello " + name + "!!" | |
def chat(name, message): | |
return "Hello " + name + "! You said: " + message | |
iface = gr.Interface(fn=chat, inputs=["text", "text"], outputs="text") | |
# Add a text window where the user and the bot can chat | |
text_window = gr.outputs.Text(label="Chat") | |
# Update the interface to include the text window | |
iface = iface.with_output(text_window) | |
iface.launch() | |