Merge d400bc5edf3a3510d29497b9a7b6b1d1d8eb730d into 34fc1fdf0d8ff520e2bb18267d046ca207c78ef9

This commit is contained in:
Karel Vesely 2025-07-21 15:09:47 +08:00 committed by GitHub
commit e2a7c50bea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1408,9 +1408,11 @@ def run(rank, world_size, args):
T = ((c.num_frames - 7) // 2 + 1) // 2
tokens = sp.encode(c.supervisions[0].text, out_type=str)
if T < len(tokens):
# For CTC `(T - 2) < len(tokens)` is needed. otherwise inf. in loss appears.
# For Transducer `T < len(tokens)` was okay.
if (T - 2) < len(tokens):
logging.warning(
f"Exclude cut with ID {c.id} from training. "
f"Exclude cut with ID {c.id} from training (too many supervision tokens). "
f"Number of frames (before subsampling): {c.num_frames}. "
f"Number of frames (after subsampling): {T}. "
f"Text: {c.supervisions[0].text}. "