Spaces:
Runtime error
Runtime error
anuragshas
commited on
Commit
Β·
6311524
1
Parent(s):
23ab019
Update app.py
Browse files
app.py
CHANGED
@@ -28,22 +28,10 @@ def predict_and_ctc_lm_decode(input_file):
|
|
28 |
return transcribed_text["text"]
|
29 |
|
30 |
|
31 |
-
def speech_recognize(file_upload, file_mic):
|
32 |
-
if file_upload is not None:
|
33 |
-
file = file_upload
|
34 |
-
elif file_mic is not None:
|
35 |
-
file = file_mic
|
36 |
-
else:
|
37 |
-
return ""
|
38 |
-
text = predict_and_ctc_lm_decode(file)
|
39 |
-
return text
|
40 |
-
|
41 |
-
|
42 |
gr.Interface(
|
43 |
speech_recognize,
|
44 |
inputs=[
|
45 |
-
gr.inputs.Audio(source="upload", type="filepath",
|
46 |
-
gr.inputs.Audio(source="microphone", type="filepath", optional=True),
|
47 |
],
|
48 |
outputs=[gr.outputs.Textbox()],
|
49 |
examples=[["example1.mp3", "example1.mp3"]],
|
|
|
28 |
return transcribed_text["text"]
|
29 |
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
gr.Interface(
|
32 |
speech_recognize,
|
33 |
inputs=[
|
34 |
+
gr.inputs.Audio(source="upload", type="filepath", label="Record your audio")
|
|
|
35 |
],
|
36 |
outputs=[gr.outputs.Textbox()],
|
37 |
examples=[["example1.mp3", "example1.mp3"]],
|