Update app.py
Browse files
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.
|
10 |
-
|
11 |
-
iface
|
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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|