antfraia commited on
Commit
cd06e6a
·
1 Parent(s): 4e86b8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -1,20 +1,11 @@
1
  import gradio as gr
2
  import whisper
3
 
4
- def convert_to_text(audio_path: str) -> str:
5
  model = whisper.load_model("base")
6
  result = model.transcribe(audio_path)
7
  return result["text"]
8
 
9
- audio_input = gr.inputs.Audio(type="file", label="Upload an Audio")
10
-
11
- iface = gr.Interface(
12
- fn=convert_to_text,
13
- inputs=audio_input,
14
- outputs="text",
15
- title="Transform your audio into text",
16
- description="Upload an audio here, either from your mobile or laptop and get it transcribed in a matter of seconds.",
17
- theme="Monochrome"
18
- )
19
-
20
- iface.launch()
 
1
  import gradio as gr
2
  import whisper
3
 
4
+ def convert_to_text(audio_path : str) -> str:
5
  model = whisper.load_model("base")
6
  result = model.transcribe(audio_path)
7
  return result["text"]
8
 
9
+ audio_input = gr.components.Audio(type="filepath")
10
+ iface = gr.Interface(fn=convert_to_text, inputs=audio_input, outputs="text")
11
+ iface.launch()