Spaces:
Runtime error
Runtime error
SteveDigital
commited on
Commit
•
4c963d0
1
Parent(s):
90b6e83
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
import whisper
|
3 |
|
4 |
-
def speech_to_text(
|
5 |
model = whisper.load_model(model_size)
|
6 |
-
source = uploaded if uploaded is not None else
|
7 |
result = model.transcribe(source)
|
8 |
return f'{result["text"]}'
|
9 |
|
@@ -18,7 +18,6 @@ gr.Interface(
|
|
18 |
description="",
|
19 |
fn=speech_to_text,
|
20 |
inputs=[
|
21 |
-
"tmp.mp3",
|
22 |
gr.Audio(source="upload", type="filepath", label="Upload Audio"),
|
23 |
gr.Dropdown(label="Select model size",value="base",choices=["tiny", "base", "small", "medium", "large"])],
|
24 |
outputs="text").launch(debug = True)
|
|
|
1 |
import gradio as gr
|
2 |
import whisper
|
3 |
|
4 |
+
def speech_to_text(uploaded, model_size):
|
5 |
model = whisper.load_model(model_size)
|
6 |
+
source = uploaded if uploaded is not None else ''
|
7 |
result = model.transcribe(source)
|
8 |
return f'{result["text"]}'
|
9 |
|
|
|
18 |
description="",
|
19 |
fn=speech_to_text,
|
20 |
inputs=[
|
|
|
21 |
gr.Audio(source="upload", type="filepath", label="Upload Audio"),
|
22 |
gr.Dropdown(label="Select model size",value="base",choices=["tiny", "base", "small", "medium", "large"])],
|
23 |
outputs="text").launch(debug = True)
|