Spaces:
Build error
Build error
Commit
·
f4b1aae
1
Parent(s):
610198f
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,19 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import whisper
|
|
|
|
|
|
|
| 4 |
model = whisper.load_model("base")
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
| 1 |
+
# Imports
|
| 2 |
+
!pip install git+https://github.com/openai/whisper.git
|
| 3 |
import gradio as gr
|
| 4 |
import whisper
|
| 5 |
+
|
| 6 |
+
#Loading the model from openai Whisper
|
| 7 |
model = whisper.load_model("base")
|
| 8 |
|
| 9 |
+
# Defining the transcription function
|
| 10 |
+
def transcribing(audio):
|
| 11 |
+
text = model.transcribe(audio)["text"]
|
| 12 |
+
return text
|
| 13 |
|
| 14 |
+
# Defining the audio filepaths
|
| 15 |
+
audio = gr.inputs.Audio(type="filepath")
|
| 16 |
|
| 17 |
+
# Loading the gradio framwork
|
| 18 |
+
iface = gr.Interface(fn=transcribing,inputs=audio, outputs="text", title="Transcribe.AI")
|
| 19 |
+
iface.launch()
|