Spaces:
Sleeping
Sleeping
Update model.py
Browse files
model.py
CHANGED
|
@@ -186,7 +186,10 @@ class Encoder(nn.Module):
|
|
| 186 |
|
| 187 |
return outputs
|
| 188 |
|
| 189 |
-
def inference(self, x):
|
|
|
|
|
|
|
|
|
|
| 190 |
for conv in self.convolutions:
|
| 191 |
x = F.dropout(F.relu(conv(x)), 0.5, self.training)
|
| 192 |
|
|
|
|
| 186 |
|
| 187 |
return outputs
|
| 188 |
|
| 189 |
+
def inference(self, x, speaker_embedding):
|
| 190 |
+
# Modify the input x to concatenate the speaker embedding
|
| 191 |
+
x = torch.cat((x, speaker_embedding.unsqueeze(1).expand(-1, x.size(1), -1)), dim=-1)
|
| 192 |
+
|
| 193 |
for conv in self.convolutions:
|
| 194 |
x = F.dropout(F.relu(conv(x)), 0.5, self.training)
|
| 195 |
|