remix867 commited on
Commit
2982df7
1 Parent(s): c38d20a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -197,6 +197,8 @@ def align(transcription, segments, group_by_speaker=True):
197
  # get the diarizer end timestamp
198
  end_time = segment["segment"]["end"]
199
  # find the ASR end timestamp that is closest to the diarizer's end timestamp and cut the transcript to here
 
 
200
  upto_idx = np.argmin(np.abs(end_timestamps - end_time))
201
 
202
  if group_by_speaker:
 
197
  # get the diarizer end timestamp
198
  end_time = segment["segment"]["end"]
199
  # find the ASR end timestamp that is closest to the diarizer's end timestamp and cut the transcript to here
200
+ if len(end_timestamps) == 0:
201
+ continue
202
  upto_idx = np.argmin(np.abs(end_timestamps - end_time))
203
 
204
  if group_by_speaker: