Spaces:
Runtime error
Runtime error
Update gradioapp.py
Browse files- gradioapp.py +15 -3
gradioapp.py
CHANGED
|
@@ -1,7 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
|
|
|
| 3 |
def greet(name):
|
| 4 |
-
return "Hello
|
| 5 |
|
| 6 |
-
|
| 7 |
-
iface.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|