Skip to content

Commit

Permalink
pad cuts by num_samples as default (#1449)
Browse files Browse the repository at this point in the history
fix duration precision issue:

https://github.com/lhotse-speech/lhotse/blob/509f4a97ab79a9eaeb8ba377d2a8e4acc794e45b/lhotse/cut/set.py#L2967

0.15052083333333321 * 24000 = 3,612.5 = 3,613
0.15052083 * 24000 = 3,612.49992 = 3,612

Co-authored-by: Piotr Żelasko <[email protected]>
  • Loading branch information
pengzhendong and pzelasko authored Feb 11, 2025
1 parent afd7cce commit 13c7616
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lhotse/dataset/collation.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def collate_audio(

cuts = maybe_pad(
cuts,
duration=max(cut.duration for cut in cuts),
num_samples=max(cut_id2num_samples.values()),
direction=pad_direction,
preserve_id=True,
)
Expand Down

0 comments on commit 13c7616

Please sign in to comment.