samusander commited on
Commit
f4b1aae
1 Parent(s): 610198f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -5
app.py CHANGED
@@ -1,11 +1,19 @@
1
- pip install git+https://github.com/openai/whisper.git
 
2
  import gradio as gr
3
  import whisper
 
 
4
  model = whisper.load_model("base")
5
 
6
- def transcribing(file):
7
- return model.transcribe(file)
 
 
8
 
9
- iface = gr.Interface(fn=transcribing, inputs = gr.inputs.File(file_count="multiple",label="Input Files"), outputs="text", title="Transcription")
 
10
 
11
- iface.launch()
 
 
 
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()