THEFIG commited on
Commit
cbb8ecd
·
verified ·
1 Parent(s): 52ecadc

Update gradioapp.py

Browse files
Files changed (1) hide show
  1. gradioapp.py +15 -3
gradioapp.py CHANGED
@@ -1,7 +1,19 @@
1
  import gradio as gr
2
 
 
3
  def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ # Define the greeting function
4
  def greet(name):
5
+ return f"Hello {name}!!"
6
 
7
+ # Create the Gradio interface
8
+ iface = gr.Interface(
9
+ fn=greet, # The function to be wrapped
10
+ inputs=gr.inputs.Textbox(lines=1, placeholder="Enter your name..."), # Improved input interface
11
+ outputs=gr.outputs.Textbox(label="Greeting"), # Improved output interface with a label
12
+ title="Greeting App", # Added a title for the interface
13
+ description="A simple app to greet you! Just enter your name and get a personalized greeting.", # Added a description
14
+ theme="default", # Set a theme for the interface, can be customized
15
+ live=True # Enable live updates if you want the response as the user types
16
+ )
17
+
18
+ # Launch the interface
19
+ iface.launch(share=True) # Added `share=True` to allow easy sharing of the app