Skip to content

Commit

Permalink
pad cuts by num_samples as default
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
  • Loading branch information
pengzhendong authored Jan 19, 2025
1 parent 509f4a9 commit 46e2b56
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 46e2b56

Please sign in to comment.