Skip to content

Commit f410c25

Browse files
authored
Merge pull request #18 from kadarakos/fix-cropping-upper-bound
Fix upper-bound calculation for cropping
2 parents b210114 + f386b6d commit f410c25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stable_audio_tools/data/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def __call__(self, source: torch.Tensor) -> Tuple[torch.Tensor, float, float, in
3737

3838
offset = 0
3939
if(self.randomize and n_samples > self.n_samples):
40-
offset = random.randint(0, upper_bound + 1)
40+
offset = random.randint(0, upper_bound)
4141

4242
t_start = offset / (upper_bound + self.n_samples)
4343
t_end = (offset + self.n_samples) / (upper_bound + self.n_samples)

0 commit comments

Comments
 (0)