SteveDigital commited on
Commit
4c963d0
1 Parent(s): 90b6e83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -1,9 +1,9 @@
1
  import gradio as gr
2
  import whisper
3
 
4
- def speech_to_text(tmp_filename, uploaded, model_size):
5
  model = whisper.load_model(model_size)
6
- source = uploaded if uploaded is not None else tmp_filename
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)