HACK pulse noise at End of sentence
Browse files- models.py +1 -1
- msinference.py +1 -2
models.py
CHANGED
@@ -299,7 +299,7 @@ class AdaIN1d(nn.Module):
|
|
299 |
h = h.view(h.size(0), h.size(1), 1)
|
300 |
gamma, beta = torch.chunk(h, chunks=2, dim=1)
|
301 |
# affine (1 + lin(x)) * inst(x) + lin(x) is this a skip connection where the weight is a lin of itself
|
302 |
-
return (1 + gamma) * self.norm(x) + beta
|
303 |
|
304 |
class UpSample1d(nn.Module):
|
305 |
def __init__(self, layer_type):
|
|
|
299 |
h = h.view(h.size(0), h.size(1), 1)
|
300 |
gamma, beta = torch.chunk(h, chunks=2, dim=1)
|
301 |
# affine (1 + lin(x)) * inst(x) + lin(x) is this a skip connection where the weight is a lin of itself
|
302 |
+
return (1 + gamma) * self.norm(x) + beta # norm(x) = PLBERT has norm / beta&gamma = style has no norm()
|
303 |
|
304 |
class UpSample1d(nn.Module):
|
305 |
def __init__(self, layer_type):
|
msinference.py
CHANGED
@@ -240,8 +240,7 @@ def inference(text,
|
|
240 |
x = model.decoder(asr,
|
241 |
F0_pred, N_pred, ref.squeeze().unsqueeze(0))
|
242 |
|
243 |
-
|
244 |
-
x = x.squeeze().cpu().numpy()[..., :-74] # weird pulse at the end of the model
|
245 |
|
246 |
x /= np.abs(x).max() + 1e-7
|
247 |
|
|
|
240 |
x = model.decoder(asr,
|
241 |
F0_pred, N_pred, ref.squeeze().unsqueeze(0))
|
242 |
|
243 |
+
x = x.squeeze().cpu().numpy()[..., :-2504] # weird pulse at the end of sentences
|
|
|
244 |
|
245 |
x /= np.abs(x).max() + 1e-7
|
246 |
|