File size: 559 Bytes
3f44072
de18ebe
3f44072
de18ebe
3f44072
b66750f
3f44072
 
 
 
 
b66750f
 
 
3f44072
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import gradio as gr
from pyannote.audio import Pipeline

def diarization(audio):
    pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
    output = pipeline(audio)
    answer = ""
    for turn, _, speaker in output.itertracks(yield_label=True):
        answer += "{} said something starting from {} and ends on {}\n".format(speaker,turn.start,turn.end)
    return answer

app = gr.Interface(fn=diarization,
                inputs=gr.inputs.Audio(source="upload", type="filepath", label="audio"),
                outputs="text")
app.launch()