Mustafa Al Hamad commited on
Commit ·
bffa2b0
1
Parent(s): 8e4d7c6
Create new file
Browse files
app.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def welcome(name):
|
| 4 |
+
return f"Welcome to Gradio, {name}!"
|
| 5 |
+
|
| 6 |
+
with gr.Blocks() as demo:
|
| 7 |
+
gr.Markdown(
|
| 8 |
+
"""
|
| 9 |
+
# Listen to a sample!
|
| 10 |
+
Select a sample at the bottom to listen to.
|
| 11 |
+
""")
|
| 12 |
+
inp = gr.Audio(source="")
|
| 13 |
+
out = None
|
| 14 |
+
examples = gr.Examples(examples=[[("announcer_begins_60sec (1).mp3")],[("announcer_begins_60sec (2).mp3")]],inputs=inp)
|
| 15 |
+
inp.change(welcome, inp, out)
|
| 16 |
+
|
| 17 |
+
if __name__ == "__main__":
|
| 18 |
+
demo.launch()
|