|
2 | 2 | import torch.nn as nn |
3 | 3 | import torch.nn.functional as F |
4 | 4 |
|
5 | | -from modules.commons.common_layers import SinusoidalPosEmb, SwiGLU, Conv1d, Transpose |
| 5 | +from modules.commons.common_layers import SinusoidalPosEmb, SwiGLU, Transpose |
6 | 6 | from utils.hparams import hparams |
7 | 7 |
|
8 | 8 |
|
@@ -42,6 +42,8 @@ def __init__(self, in_dims, n_feats, *, num_layers=6, num_channels=512, expansio |
42 | 42 | self.n_feats = n_feats |
43 | 43 | self.input_projection = nn.Linear(in_dims * n_feats, num_channels) |
44 | 44 | self.conditioner_projection = nn.Linear(hparams['hidden_size'], num_channels) |
| 45 | + # It may need to be modified at some point to be compatible with the condition cache |
| 46 | + # self.conditioner_projection = nn.Conv1d(hparams['hidden_size'], num_channels, 1) |
45 | 47 | self.diffusion_embedding = nn.Sequential( |
46 | 48 | SinusoidalPosEmb(num_channels), |
47 | 49 | nn.Linear(num_channels, num_channels * 4), |
@@ -80,6 +82,8 @@ def forward(self, spec, diffusion_step, cond): |
80 | 82 |
|
81 | 83 | x = self.input_projection(x.transpose(1, 2)) # [B, T, F x M] |
82 | 84 | x = x + self.conditioner_projection(cond.transpose(1, 2)) |
| 85 | + # It may need to be modified at some point to be compatible with the condition cache |
| 86 | + # x = x + self.conditioner_projection(cond.transpose(1, 2)) |
83 | 87 | x = x + self.diffusion_embedding(diffusion_step).unsqueeze(1) |
84 | 88 |
|
85 | 89 | for layer in self.residual_layers: |
|
0 commit comments