From 802998674eb47ff5af50b6252236eefed9c3482d Mon Sep 17 00:00:00 2001 From: James Betker Date: Mon, 4 Jul 2022 16:47:57 -0600 Subject: [PATCH] Fix another edge case --- codes/models/audio/music/tfdpc_v5.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/models/audio/music/tfdpc_v5.py b/codes/models/audio/music/tfdpc_v5.py index a64f8368..c2186133 100644 --- a/codes/models/audio/music/tfdpc_v5.py +++ b/codes/models/audio/music/tfdpc_v5.py @@ -203,7 +203,7 @@ class TransformerDiffusionWithPointConditioning(nn.Module): else: if self.training and self.conditioning_masking > 0: mask_prop = random.random() * self.conditioning_masking - mask_len = max(int(N * mask_prop), 4) + mask_len = max(int(N * mask_prop), 16) assert N-mask_len > 8, f"Use longer inputs or shorter conditioning_masking proportion. {N-mask_len}" seg_start = random.randint(8, (N-mask_len)) + cond_start # Readjust mask_len to ensure at least 8 sequence elements on the end as well