File size: 831 Bytes
b9fd5ae
 
cbb8ecd
b9fd5ae
cbb8ecd
b9fd5ae
cbb8ecd
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr

# Define the greeting function
def greet(name):
    return f"Hello {name}!!"

# Create the Gradio interface
iface = gr.Interface(
    fn=greet,  # The function to be wrapped
    inputs=gr.inputs.Textbox(lines=1, placeholder="Enter your name..."),  # Improved input interface
    outputs=gr.outputs.Textbox(label="Greeting"),  # Improved output interface with a label
    title="Greeting App",  # Added a title for the interface
    description="A simple app to greet you! Just enter your name and get a personalized greeting.",  # Added a description
    theme="default",  # Set a theme for the interface, can be customized
    live=True  # Enable live updates if you want the response as the user types
)

# Launch the interface
iface.launch(share=True)  # Added `share=True` to allow easy sharing of the app