Skip to content

Commit 0b50345

Browse files
committed
latency script, small bug fixes
1 parent 9e9124b commit 0b50345

File tree

1 file changed

+5
-1
lines changed
  • users/zeyer/experiments/exp2023_02_16_chunked_attention/scripts

1 file changed

+5
-1
lines changed

users/zeyer/experiments/exp2023_02_16_chunked_attention/scripts/latency.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,11 @@ def get_phone_alignment_word_ends(deps: Deps, segment_name: str) -> List[Decimal
349349
lemma = deps.lexicon.special_phones[center]
350350
if "" in lemma.orth: # e.g. silence
351351
continue # skip silence or similar
352-
if time_idx + 1 >= len(phone_alignment) or phone_alignment[time_idx + 1][1] == allophone_idx:
352+
if (
353+
time_idx + 1 < len(phone_alignment)
354+
and phone_alignment[time_idx + 1][1] == allophone_idx
355+
and phone_alignment[time_idx + 1][2] >= state
356+
):
353357
continue # skip to the last frame for this phoneme
354358
cur_word_phones.append(center)
355359

0 commit comments

Comments
 (0)