Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def triggered_by_clear_event(hidden_in):
|
4 |
+
print(hidden_in)
|
5 |
+
return "Hello"
|
6 |
+
|
7 |
+
with gr.Blocks() as demo:
|
8 |
+
with gr.Row():
|
9 |
+
with gr.Column():
|
10 |
+
audio_in = gr.Audio(label="Audio Component", source="microphone", type="filepath")
|
11 |
+
hidden_in = gr.Textbox(value="HIDDEN TEXT", visible=False)
|
12 |
+
submit_btn : gr.Button("Submit")
|
13 |
+
result = gr.Textbox(label="Result")
|
14 |
+
|
15 |
+
audio_in.clear(
|
16 |
+
fn = triggered_by_clear_event,
|
17 |
+
inputs = [hidden_in]
|
18 |
+
outputs = [result]
|
19 |
+
)
|
20 |
+
|
21 |
+
demo.queue().launch()
|
22 |
+
|