dawnrennlabs commited on
Commit ·
ff95778
1
Parent(s): 2c406ce
chore: update
Browse files
app.py
CHANGED
|
@@ -38,12 +38,12 @@ with gr.Blocks() as demo:
|
|
| 38 |
gr.Markdown("# Audio Transcription Demo")
|
| 39 |
with gr.Tabs():
|
| 40 |
with gr.TabItem("Microphone Input"):
|
| 41 |
-
audio_stream = gr.Audio(
|
| 42 |
text_output_stream = gr.Textbox(label="Transcription")
|
| 43 |
audio_stream.stream(transcribe_stream, inputs=[gr.State(), audio_stream], outputs=[gr.State(), text_output_stream])
|
| 44 |
|
| 45 |
with gr.TabItem("File Upload"):
|
| 46 |
-
audio_file = gr.Audio(
|
| 47 |
text_output_file = gr.Textbox(label="Transcription")
|
| 48 |
transcribe_btn = gr.Button("Transcribe")
|
| 49 |
transcribe_btn.click(transcribe_file, inputs=[audio_file], outputs=[text_output_file])
|
|
|
|
| 38 |
gr.Markdown("# Audio Transcription Demo")
|
| 39 |
with gr.Tabs():
|
| 40 |
with gr.TabItem("Microphone Input"):
|
| 41 |
+
audio_stream = gr.Audio(streaming=True)
|
| 42 |
text_output_stream = gr.Textbox(label="Transcription")
|
| 43 |
audio_stream.stream(transcribe_stream, inputs=[gr.State(), audio_stream], outputs=[gr.State(), text_output_stream])
|
| 44 |
|
| 45 |
with gr.TabItem("File Upload"):
|
| 46 |
+
audio_file = gr.Audio(type="numpy", label="Upload Audio")
|
| 47 |
text_output_file = gr.Textbox(label="Transcription")
|
| 48 |
transcribe_btn = gr.Button("Transcribe")
|
| 49 |
transcribe_btn.click(transcribe_file, inputs=[audio_file], outputs=[text_output_file])
|