BassWow commited on
Commit
be632c4
1 Parent(s): f305011
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -15,15 +15,15 @@ def speech_to_text(tmp_filename, model_size):
15
 
16
  # detect the spoken language
17
  _, probs = model.detect_language(mel)
18
- print(f"Detected language: {max(probs, key=probs.get)}")
19
 
20
  # decode the audio
21
  options = whisper.DecodingOptions()
22
  result = whisper.decode(model, mel, options)
23
 
24
  # print the recognized text
25
- print(result.text)
26
- return f"Detected language: {max(probs, key=probs.get)}", result.text
27
 
28
 
29
  gr.Interface(
@@ -39,5 +39,5 @@ gr.Interface(
39
  inputs=[
40
  gr.Audio(label="Record your voice on your mic",source="microphone", type="filepath"),
41
  gr.Dropdown(label="Select model size",value="base",choices=["tiny", "base", "small", "medium", "large"])],
42
- outputs=["text","text"]).launch()
43
 
 
15
 
16
  # detect the spoken language
17
  _, probs = model.detect_language(mel)
18
+ #print(f"Detected language: {max(probs, key=probs.get)}")
19
 
20
  # decode the audio
21
  options = whisper.DecodingOptions()
22
  result = whisper.decode(model, mel, options)
23
 
24
  # print the recognized text
25
+ #print(result.text)
26
+ return result.text
27
 
28
 
29
  gr.Interface(
 
39
  inputs=[
40
  gr.Audio(label="Record your voice on your mic",source="microphone", type="filepath"),
41
  gr.Dropdown(label="Select model size",value="base",choices=["tiny", "base", "small", "medium", "large"])],
42
+ outputs="text").launch()
43