pull/3005/head
lym0302 3 years ago
parent 9df1294935
commit d1173b9cdb

@ -270,10 +270,10 @@ class DiffSinger(nn.Layer):
mel_fs2 = mel_fs2.unsqueeze(0).transpose((0, 2, 1)) mel_fs2 = mel_fs2.unsqueeze(0).transpose((0, 2, 1))
cond_fs2 = self.fs2.encoder_infer(text, note, note_dur, is_slur) cond_fs2 = self.fs2.encoder_infer(text, note, note_dur, is_slur)
cond_fs2 = cond_fs2.transpose((0, 2, 1)) cond_fs2 = cond_fs2.transpose((0, 2, 1))
mel, _ = self.diffusion(mel_fs2, cond_fs2) # mel, _ = self.diffusion(mel_fs2, cond_fs2)
# noise = paddle.randn(mel_fs2.shape) noise = paddle.randn(mel_fs2.shape)
# mel = self.diffusion.inference( mel = self.diffusion.inference(
# noise=noise, cond=cond_fs2, ref_x=mel_fs2, num_inference_steps=100) noise=noise, cond=cond_fs2, ref_x=mel_fs2, num_inference_steps=100)
mel = mel.transpose((0, 2, 1)) mel = mel.transpose((0, 2, 1))
return mel[0] return mel[0]

@ -372,11 +372,9 @@ class GaussianDiffusion(nn.Layer):
The noises which is added to the input. The noises which is added to the input.
""" """
# print("xxxxxxxxxxxxxxxx1: ", x, x.shape)
x = x.transpose((0, 2, 1)) x = x.transpose((0, 2, 1))
x = self.norm_spec(x) x = self.norm_spec(x)
x = x.transpose((0, 2, 1)) x = x.transpose((0, 2, 1))
print("xxxxxxxxxxxxxxxx2: ", x, x.shape)
noise_scheduler = self.noise_scheduler noise_scheduler = self.noise_scheduler
# Sample noise that we'll add to the mel-spectrograms # Sample noise that we'll add to the mel-spectrograms
@ -411,7 +409,7 @@ class GaussianDiffusion(nn.Layer):
num_inference_steps: Optional[int]=1000, num_inference_steps: Optional[int]=1000,
strength: Optional[float]=None, strength: Optional[float]=None,
scheduler_type: Optional[str]="ddpm", scheduler_type: Optional[str]="ddpm",
clip_noise: Optional[bool]=False, clip_noise: Optional[bool]=True,
clip_noise_range: Optional[Tuple[float, float]]=(-1, 1), clip_noise_range: Optional[Tuple[float, float]]=(-1, 1),
callback: Optional[Callable[[int, int, int, paddle.Tensor], callback: Optional[Callable[[int, int, int, paddle.Tensor],
None]]=None, None]]=None,

Loading…
Cancel
Save