Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,33 +29,35 @@ with gr.Blocks() as demo:
|
|
| 29 |
and π€ Transformers to transcribe audio files of max 30s length.
|
| 30 |
""")
|
| 31 |
|
| 32 |
-
with gr.
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
type="
|
| 36 |
-
|
| 37 |
interactive=True,
|
| 38 |
-
max_length=30
|
| 39 |
)
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
with gr.
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
|
|
|
| 60 |
|
| 61 |
demo.launch(share=True)
|
|
|
|
| 29 |
and π€ Transformers to transcribe audio files of max 30s length.
|
| 30 |
""")
|
| 31 |
|
| 32 |
+
with gr.Column():
|
| 33 |
+
audio_in = gr.Audio(
|
| 34 |
+
label="π€ Record or upload your audio",
|
| 35 |
+
type="filepath",
|
| 36 |
+
sources=["upload", "microphone"],
|
| 37 |
interactive=True,
|
| 38 |
+
max_length=30
|
| 39 |
)
|
| 40 |
+
with gr.Row():
|
| 41 |
+
submit_btn = gr.Button("Submit")
|
| 42 |
+
clear_btn = gr.Button("Clear")
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
with gr.Column():
|
| 46 |
+
|
| 47 |
+
transcription_txt = gr.Textbox(
|
| 48 |
+
label="π Transcription",
|
| 49 |
+
interactive=False,
|
| 50 |
+
show_label=True,
|
| 51 |
+
show_copy_button=True,
|
| 52 |
+
)
|
| 53 |
+
|
| 54 |
+
with gr.Row():
|
| 55 |
+
flag_btn = gr.Button("π© Flag this output as incorrect", size="sm")
|
| 56 |
+
share_btn = gr.Button("π Share", size="sm")
|
| 57 |
+
|
| 58 |
+
# Button wiring:
|
| 59 |
+
submit_btn.click(fn=transcribe, inputs=audio_in, outputs=transcription_txt)
|
| 60 |
+
flag_btn.click(fn=lambda: "Thank you for your feedback.", inputs=None, outputs=transcription_txt)
|
| 61 |
+
clear_btn.click(fn=lambda: (None, ""), inputs=None, outputs=[audio_input, transcription_txt])
|
| 62 |
|
| 63 |
demo.launch(share=True)
|