nithinraok commited on
Commit
1ac7d5c
β€’
1 Parent(s): 00de2d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -1,20 +1,20 @@
1
- from nemo.collections.asr.models import NeuralDiarizer
2
  import gradio as gr
3
  import pandas as pd
4
 
5
  device = "cuda" if torch.cuda.is_available() else "cpu"
6
 
7
- model = NeuralDiarizer.from_pretrained("diar_msdd_telephonic").to(device)
8
 
9
  def run_diarization(path1):
10
- annotation = model(path1)
11
- rttm=annotation.to_rttm()
12
  df = pd.DataFrame(columns=['start_time', 'end_time', 'speaker'])
13
- for idx,line in enumerate(rttm.splitlines()):
14
- split = line.split()
15
- start_time, duration, speaker = split[3], split[4], split[7]
16
- end_time = float(start_time) + float(duration)
17
- df.loc[idx] = start_time, end_time, speaker
18
  return df
19
 
20
  inputs = [
@@ -29,8 +29,8 @@ description = (
29
 
30
  article = (
31
  "<p style='text-align: center'>"
32
- "<a href='https://huggingface.co/nvidia/speakerverification_en_titanet_large' target='_blank'>πŸŽ™οΈ Learn more about TitaNet model</a> | "
33
- "<a href='https://arxiv.org/pdf/2110.04410.pdf' target='_blank'>πŸ“š TitaNet paper</a> | "
34
  "<a href='https://github.com/NVIDIA/NeMo' target='_blank'>πŸ§‘β€πŸ’» Repository</a>"
35
  "</p>"
36
  )
 
1
+ # from nemo.collections.asr.models import NeuralDiarizer
2
  import gradio as gr
3
  import pandas as pd
4
 
5
  device = "cuda" if torch.cuda.is_available() else "cpu"
6
 
7
+ # model = NeuralDiarizer.from_pretrained("diar_msdd_telephonic").to(device)
8
 
9
  def run_diarization(path1):
10
+ # annotation = model(path1)
11
+ # rttm=annotation.to_rttm()
12
  df = pd.DataFrame(columns=['start_time', 'end_time', 'speaker'])
13
+ # for idx,line in enumerate(rttm.splitlines()):
14
+ # split = line.split()
15
+ # start_time, duration, speaker = split[3], split[4], split[7]
16
+ # end_time = float(start_time) + float(duration)
17
+ # df.loc[idx] = start_time, end_time, speaker
18
  return df
19
 
20
  inputs = [
 
29
 
30
  article = (
31
  "<p style='text-align: center'>"
32
+ "<a href='https://catalog.ngc.nvidia.com/orgs/nvidia/teams/nemo/models/diar_msdd_telephonic' target='_blank'>πŸŽ™οΈ Learn more about MSDD model</a> | "
33
+ "<a href='https://arxiv.org/abs/2203.15974' target='_blank'>πŸ“š MSDD paper</a> | "
34
  "<a href='https://github.com/NVIDIA/NeMo' target='_blank'>πŸ§‘β€πŸ’» Repository</a>"
35
  "</p>"
36
  )