FahadAlam commited on
Commit
91295c2
·
1 Parent(s): 276ddba

Create new file

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # load the pipeline from Hugginface Hub
2
+ import gradio as gr
3
+ from pyannote.audio import Pipeline
4
+ pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
5
+
6
+ def speakerDiarization(audio):
7
+ # apply the pipeline to an audio file
8
+ diarization = pipeline(audio)
9
+ # dump the diarization output to disk using RTTM format
10
+ return diarization
11
+
12
+ gr.Interface(speakerDiarization,
13
+ inputs = gr.inputs.Audio(source="microphone", type="filepath", optional=True, label="Please record your voice"),
14
+ outputs = gr.outputs.Textbox(label="Output Text"),
15
+ title="ASR using Wav2Vec 2.0",
16
+ description = "This application displays transcribed text for given audio input",
17
+ examples = [["TestAudio1.wav"]], theme="grass").launch()