Spaces:
Runtime error
Runtime error
Commit
·
64ca4d6
1
Parent(s):
c5532b4
fixes error upon hitting transcribe
Browse files
app.py
CHANGED
@@ -28,11 +28,10 @@ def transcribe_audio(audio_file):
|
|
28 |
sound.export(temp_audio_path, format="wav")
|
29 |
|
30 |
# Transcribe the audio
|
31 |
-
time.sleep(5)
|
32 |
transcription = asr_model.transcribe_file(temp_audio_path)
|
33 |
|
34 |
# Clean up temporary files (optional)
|
35 |
-
|
36 |
|
37 |
return transcription
|
38 |
|
@@ -65,7 +64,7 @@ with gr.Blocks() as app:
|
|
65 |
transcription_output = gr.Textbox(label="Transcription")
|
66 |
|
67 |
transcribe_button = gr.Button("Transcribe")
|
68 |
-
transcribe_button.click(
|
69 |
|
70 |
# Launch the app
|
71 |
if __name__ == "__main__":
|
|
|
28 |
sound.export(temp_audio_path, format="wav")
|
29 |
|
30 |
# Transcribe the audio
|
|
|
31 |
transcription = asr_model.transcribe_file(temp_audio_path)
|
32 |
|
33 |
# Clean up temporary files (optional)
|
34 |
+
os.remove(temp_audio_path)
|
35 |
|
36 |
return transcription
|
37 |
|
|
|
64 |
transcription_output = gr.Textbox(label="Transcription")
|
65 |
|
66 |
transcribe_button = gr.Button("Transcribe")
|
67 |
+
transcribe_button.click(process_audio, inputs=audio_input, outputs=transcription_output)
|
68 |
|
69 |
# Launch the app
|
70 |
if __name__ == "__main__":
|