Skip to content

Commit

Permalink
Fix synthesizers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Vidalnt committed Jun 23, 2024
1 parent e9bb62a commit 309b669
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rvc/lib/algorithm/synthesizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ def remove_weight_norm(self):
"""Removes weight normalization from the model."""
self.dec.remove_weight_norm()
self.flow.remove_weight_norm()
self.enc_q.remove_weight_norm()
if hasattr(self, "enc_q"):
self.enc_q.remove_weight_norm()

def __prepare_scriptable__(self):
for hook in self.dec._forward_pre_hooks.values():
Expand Down Expand Up @@ -585,6 +586,7 @@ def infer(
"""
g = self.emb_g(sid).unsqueeze(-1)
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
x_mask = x_mask.transpose(1, 2)
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
if rate is not None:
head = int(z_p.shape[2] * (1.0 - rate.item()))
Expand Down

0 comments on commit 309b669

Please sign in to comment.