anuragshas commited on
Commit
6311524
Β·
1 Parent(s): 23ab019

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -13
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", optional=True),
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"]],