Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,25 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
3 |
def greet(name):
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
# Define the function to be used in the interface
|
4 |
def greet(name):
|
5 |
return "Hello " + name + "!!"
|
6 |
|
7 |
+
# Create a description for the interface
|
8 |
+
description = """
|
9 |
+
Welcome to the Gradio interface! This simple app greets you with a warm message.
|
10 |
+
Simply upload an image and the system will greet you based on the name in the input.
|
11 |
+
You can try it out by uploading an image!
|
12 |
+
"""
|
13 |
+
|
14 |
+
# Define the interface with inputs and outputs
|
15 |
+
demo = gr.Interface(
|
16 |
+
fn=greet,
|
17 |
+
inputs=gr.Image(label="Upload an Image"),
|
18 |
+
outputs=gr.Textbox(label="Greeting"),
|
19 |
+
live=True,
|
20 |
+
title="Greeting App",
|
21 |
+
description=description
|
22 |
+
)
|
23 |
+
|
24 |
+
# Launch the interface
|
25 |
demo.launch()
|