Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ def transcribe_speech(filepath):
|
|
37 |
|
38 |
# Create Gradio interface
|
39 |
with gr.Blocks() as demo:
|
40 |
-
gr.Markdown("# Speech to Text Converter")
|
41 |
|
42 |
with gr.Row():
|
43 |
audio_input = gr.Audio(type="filepath", label="Upload MP3 or WAV File")
|
@@ -47,19 +47,17 @@ with gr.Blocks() as demo:
|
|
47 |
output_textbox = gr.Textbox(label="Transcribed Text", lines=10)
|
48 |
download_link = gr.File(label="Download Transcription")
|
49 |
|
50 |
-
|
51 |
-
|
52 |
def update_output(filepath):
|
53 |
-
|
54 |
-
|
55 |
transcribed_text, text_file_path = transcribe_speech(filepath)
|
56 |
|
57 |
-
|
58 |
|
59 |
transcribe_button.click(
|
60 |
fn=update_output,
|
61 |
inputs=audio_input,
|
62 |
-
outputs=[
|
63 |
)
|
64 |
|
65 |
# Launch the Gradio app
|
|
|
37 |
|
38 |
# Create Gradio interface
|
39 |
with gr.Blocks() as demo:
|
40 |
+
gr.Markdown("# Speech to Text Converter (Model Downloading takes 2-3min when first start)")
|
41 |
|
42 |
with gr.Row():
|
43 |
audio_input = gr.Audio(type="filepath", label="Upload MP3 or WAV File")
|
|
|
47 |
output_textbox = gr.Textbox(label="Transcribed Text", lines=10)
|
48 |
download_link = gr.File(label="Download Transcription")
|
49 |
|
50 |
+
|
|
|
51 |
def update_output(filepath):
|
52 |
+
|
|
|
53 |
transcribed_text, text_file_path = transcribe_speech(filepath)
|
54 |
|
55 |
+
return transcribed_text, text_file_path
|
56 |
|
57 |
transcribe_button.click(
|
58 |
fn=update_output,
|
59 |
inputs=audio_input,
|
60 |
+
outputs=[output_textbox, download_link]
|
61 |
)
|
62 |
|
63 |
# Launch the Gradio app
|