Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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:
|