Spaces:
Sleeping
Sleeping
kozak-vaclav
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -62,14 +62,27 @@ def transcribe(audio_path):
|
|
62 |
|
63 |
return transcription[0]
|
64 |
|
65 |
-
|
66 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
fn=transcribe,
|
68 |
-
inputs=gr.
|
69 |
-
outputs=
|
70 |
-
title="Kobraspeech RNN ASR demo (cs)",
|
71 |
-
description="Upload an audio file or record your voice to get the transcription."
|
72 |
)
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
if __name__ == "__main__":
|
75 |
iface.launch()
|
|
|
62 |
|
63 |
return transcription[0]
|
64 |
|
65 |
+
demo = gr.Blocks()
|
66 |
+
|
67 |
+
mic_transcribe = gr.Interface(
|
68 |
+
fn=transcribe,
|
69 |
+
inputs=gr.Audio(sources="microphone", type="filepath"),
|
70 |
+
outputs=gr.outputs.Textbox(),
|
71 |
+
)
|
72 |
+
|
73 |
+
file_transcribe = gr.Interface(
|
74 |
fn=transcribe,
|
75 |
+
inputs=gr.Audio(sources="upload", type="filepath"),
|
76 |
+
outputs=gr.outputs.Textbox(),
|
|
|
|
|
77 |
)
|
78 |
|
79 |
+
with demo:
|
80 |
+
gr.TabbedInterface(
|
81 |
+
[mic_transcribe, file_transcribe],
|
82 |
+
["Transcribe Microphone", "Transcribe Audio File"],
|
83 |
+
)
|
84 |
+
|
85 |
+
demo.launch(debug=True)
|
86 |
+
|
87 |
if __name__ == "__main__":
|
88 |
iface.launch()
|