mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-01-23 05:25:01 +03:00
onnx improvement
This commit is contained in:
parent
80a5ba91b8
commit
8e822c16e3
@ -63,7 +63,7 @@ class SynthesizerTrnMs256NSFsid_ONNX(nn.Module):
|
||||
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
|
||||
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
|
||||
z = self.flow(z_p, x_mask, g=g, reverse=True)
|
||||
o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], nsff0, g=g, convert_length=convert_length)
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
|
||||
|
||||
# o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], nsff0, g=g, convert_length=convert_length)
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], nsff0, g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
||||
|
@ -62,5 +62,6 @@ class SynthesizerTrnMs256NSFsid_nono_ONNX(nn.Module):
|
||||
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
|
||||
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
|
||||
z = self.flow(z_p, x_mask, g=g, reverse=True)
|
||||
o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], g=g, convert_length=convert_length)
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
||||
|
@ -67,4 +67,4 @@ class SynthesizerTrnMs768NSFsid_ONNX(nn.Module):
|
||||
# o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], nsff0, g=g, convert_length=convert_length)
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], nsff0, g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
||||
return o
|
||||
|
@ -86,5 +86,6 @@ class SynthesizerTrnMs768NSFsid_nono_ONNX(nn.Module):
|
||||
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
|
||||
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
|
||||
z = self.flow(z_p, x_mask, g=g, reverse=True)
|
||||
o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], g=g, convert_length=convert_length)
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
@ -65,5 +65,7 @@ class SynthesizerTrnMsNSFsidNono_webui_ONNX(nn.Module):
|
||||
m_p, logs_p, x_mask = self.enc_p(phone, None, phone_lengths)
|
||||
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
|
||||
z = self.flow(z_p, x_mask, g=g, reverse=True)
|
||||
o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], g=g, convert_length=convert_length)
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
||||
|
@ -66,6 +66,7 @@ class SynthesizerTrnMsNSFsid_webui_ONNX(nn.Module):
|
||||
m_p, logs_p, x_mask = self.enc_p(phone, pitch, phone_lengths)
|
||||
z_p = (m_p + torch.exp(logs_p) * torch.randn_like(m_p) * 0.66666) * x_mask
|
||||
z = self.flow(z_p, x_mask, g=g, reverse=True)
|
||||
o = self.dec.infer_realtime((z * x_mask)[:, :, :max_len], nsff0, g=g, convert_length=convert_length)
|
||||
return o, x_mask, (z, z_p, m_p, logs_p)
|
||||
|
||||
o = self.dec((z * x_mask)[:, :, :max_len], nsff0, g=g)
|
||||
o = torch.clip(o[0, 0], -1.0, 1.0)
|
||||
return o
|
||||
|
Loading…
Reference in New Issue
Block a user