Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,25 +2,18 @@ import gradio as gr
|
|
2 |
from PIL import Image
|
3 |
import time
|
4 |
|
5 |
-
def
|
6 |
time.sleep(1) # Simulate a delay
|
7 |
-
return image
|
8 |
-
|
9 |
-
def process_audio(audio):
|
10 |
-
time.sleep(1) # Simulate a delay
|
11 |
-
return audio
|
12 |
-
|
13 |
-
def button_click():
|
14 |
-
return "π You clicked the button!"
|
15 |
|
16 |
# Create Gradio Interface
|
17 |
demo = gr.Interface(
|
18 |
-
|
|
|
19 |
gr.Image(type="pil", label="Upload an image"),
|
20 |
gr.Audio(label="Upload an audio file"),
|
21 |
-
gr.Button("Click Me"
|
22 |
],
|
23 |
-
fn=[process_image, process_audio, button_click],
|
24 |
outputs=["image", "audio", "text"],
|
25 |
title="Gradio Demo on Hugging Face",
|
26 |
description="Welcome to a demo app showcasing basic Gradio components!"
|
|
|
2 |
from PIL import Image
|
3 |
import time
|
4 |
|
5 |
+
def process_inputs(image, audio, button_click):
|
6 |
time.sleep(1) # Simulate a delay
|
7 |
+
return image, audio, "π You clicked the button!" if button_click else ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
# Create Gradio Interface
|
10 |
demo = gr.Interface(
|
11 |
+
fn=process_inputs,
|
12 |
+
inputs=[
|
13 |
gr.Image(type="pil", label="Upload an image"),
|
14 |
gr.Audio(label="Upload an audio file"),
|
15 |
+
gr.Button("Click Me")
|
16 |
],
|
|
|
17 |
outputs=["image", "audio", "text"],
|
18 |
title="Gradio Demo on Hugging Face",
|
19 |
description="Welcome to a demo app showcasing basic Gradio components!"
|