Spaces:
Runtime error
Runtime error
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
|
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=
|
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 |
|