Cahlil-Togonon
commited on
Commit
·
b66750f
1
Parent(s):
fa81eef
bug fix app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,17 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from pyannote.audio import Pipeline
|
3 |
|
4 |
def diarization(audio):
|
5 |
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
|
6 |
-
output = pipeline(
|
7 |
answer = ""
|
8 |
for turn, _, speaker in output.itertracks(yield_label=True):
|
9 |
answer += "{} said something starting from {} and ends on {}\n".format(speaker,turn.start,turn.end)
|
10 |
return answer
|
11 |
|
12 |
-
app = gr.Interface(fn=diarization,
|
|
|
|
|
13 |
app.launch()
|
|
|
1 |
+
import os
|
2 |
+
os.add_dll_directory("C://Users/Elyz/anaconda3/envs/pyannote/Lib/site-packages/torchaudio/lib/libtorchaudio.pyd")
|
3 |
import gradio as gr
|
4 |
from pyannote.audio import Pipeline
|
5 |
|
6 |
def diarization(audio):
|
7 |
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
|
8 |
+
output = pipeline(audio)
|
9 |
answer = ""
|
10 |
for turn, _, speaker in output.itertracks(yield_label=True):
|
11 |
answer += "{} said something starting from {} and ends on {}\n".format(speaker,turn.start,turn.end)
|
12 |
return answer
|
13 |
|
14 |
+
app = gr.Interface(fn=diarization,
|
15 |
+
inputs=gr.inputs.Audio(source="upload", type="filepath", label="audio"),
|
16 |
+
outputs="text")
|
17 |
app.launch()
|