Skip to content

Commit

Permalink
update inference step
Browse files Browse the repository at this point in the history
  • Loading branch information
lym0302 committed Mar 8, 2023
1 parent f71f481 commit 3df69e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion paddlespeech/t2s/models/diffsinger/diffsinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def forward(self, text, note, note_dur, is_slur, get_mel_fs2: bool=False):
note_dur=note_dur,
is_slur=is_slur,
get_mel_fs2=get_mel_fs2)
logmel = self.normalizer.inverse(normalized_mel)
logmel = normalized_mel
return logmel


Expand Down
5 changes: 4 additions & 1 deletion paddlespeech/t2s/modules/diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def inference(self,
num_inference_steps: Optional[int]=1000,
strength: Optional[float]=None,
scheduler_type: Optional[str]="ddpm",
clip_noise: Optional[bool]=True,
clip_noise: Optional[bool]=False,
clip_noise_range: Optional[Tuple[float, float]]=(-1, 1),
callback: Optional[Callable[[int, int, int, paddle.Tensor],
None]]=None,
Expand Down Expand Up @@ -302,6 +302,9 @@ def inference(self,
noisy_input = scheduler.add_noise(ref_x, noise, timesteps[0])

denoised_output = noisy_input
if clip_noise:
n_min, n_max = clip_noise_range
denoised_output = paddle.clip(denoised_output, n_min, n_max)
for i, t in enumerate(timesteps):
denoised_output = scheduler.scale_model_input(denoised_output, t)
noise_pred = self.denoiser(denoised_output, t, cond)
Expand Down

0 comments on commit 3df69e7

Please sign in to comment.