Spaces:
Sleeping
Sleeping
zanemotiwala
commited on
Commit
•
ccee400
1
Parent(s):
9854ee3
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
import logging
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
def transcribe_speech(audio_file):
|
9 |
-
if audio_file is None:
|
10 |
logging.error("No audio file provided.")
|
11 |
return "No audio found, please retry."
|
12 |
try:
|
13 |
-
logging.info(f"Processing file: {
|
14 |
-
output = asr(
|
15 |
return output["text"]
|
16 |
except Exception as e:
|
17 |
logging.error(f"Error during transcription: {str(e)}")
|
@@ -29,4 +26,3 @@ with gr.Blocks() as demo:
|
|
29 |
transcribe_button.click(transcribe_speech, inputs=mic, outputs=transcription)
|
30 |
|
31 |
demo.launch(share=True)
|
32 |
-
|
|
|
1 |
import gradio as gr
|
2 |
import logging
|
3 |
|
4 |
+
# Adjusted function assuming 'asr' expects a file path as input
|
5 |
+
def transcribe_speech(audio_file_path):
|
6 |
+
if not audio_file_path:
|
|
|
|
|
|
|
7 |
logging.error("No audio file provided.")
|
8 |
return "No audio found, please retry."
|
9 |
try:
|
10 |
+
logging.info(f"Processing file: {audio_file_path}")
|
11 |
+
output = asr(audio_file_path) # Assuming `asr` directly takes a file path
|
12 |
return output["text"]
|
13 |
except Exception as e:
|
14 |
logging.error(f"Error during transcription: {str(e)}")
|
|
|
26 |
transcribe_button.click(transcribe_speech, inputs=mic, outputs=transcription)
|
27 |
|
28 |
demo.launch(share=True)
|
|