kabita-choudhary commited on
Commit
5ad83b4
1 Parent(s): 6364f03

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -2,8 +2,8 @@ import gradio as gr
2
  import pandas as pd
3
  from pyannote.audio import Pipeline
4
  pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization",use_auth_token="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")
5
- def diarization():
6
- diarization = pipeline("result.wav")
7
  speakertime=[]
8
  # print the result
9
  for turn, _, speaker in diarization.itertracks(yield_label=True):
@@ -16,7 +16,7 @@ def diarization():
16
  df = pd.DataFrame(speakertime,columns=['start', 'end','speaker'])
17
  text=[]
18
  for i in range (df.start.count()):
19
- text.append(generatetext("result.wav",df.start[i], df.end[i]))
20
  df['text']=text
21
  with open('my_file.txt', 'w') as my_file:
22
  for i in range (df.start.count()):
 
2
  import pandas as pd
3
  from pyannote.audio import Pipeline
4
  pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization",use_auth_token="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")
5
+ def diarization(inp_audio):
6
+ diarization = pipeline(inp_audio)
7
  speakertime=[]
8
  # print the result
9
  for turn, _, speaker in diarization.itertracks(yield_label=True):
 
16
  df = pd.DataFrame(speakertime,columns=['start', 'end','speaker'])
17
  text=[]
18
  for i in range (df.start.count()):
19
+ text.append(generatetext(inp_audio,df.start[i], df.end[i]))
20
  df['text']=text
21
  with open('my_file.txt', 'w') as my_file:
22
  for i in range (df.start.count()):