isom5240ust commited on
Commit
a81134e
Β·
verified Β·
1 Parent(s): 1f8154e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -12
app.py CHANGED
@@ -2,25 +2,18 @@ import gradio as gr
2
  from PIL import Image
3
  import time
4
 
5
- def process_image(image):
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", elem_id="btn")
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!"