Skip to content

Commit

Permalink
update: bert_vits2
Browse files Browse the repository at this point in the history
  • Loading branch information
Artrajz committed Sep 20, 2023
1 parent 0446273 commit 893ee70
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions bert_vits2/attentions.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_s
self.kernel_size = kernel_size
self.p_dropout = p_dropout
self.window_size = window_size
if isflow:
cond_layer = torch.nn.Conv1d(256, 2 * hidden_channels * n_layers, 1)
self.cond_pre = torch.nn.Conv1d(hidden_channels, 2 * hidden_channels, 1)
self.cond_layer = weight_norm(cond_layer, name='weight')
self.gin_channels = 256
# if isflow:
# cond_layer = torch.nn.Conv1d(256, 2 * hidden_channels * n_layers, 1)
# self.cond_pre = torch.nn.Conv1d(hidden_channels, 2 * hidden_channels, 1)
# self.cond_layer = weight_norm(cond_layer, name='weight')
# self.gin_channels = 256
self.cond_layer_idx = self.n_layers
if 'gin_channels' in kwargs:
self.gin_channels = kwargs['gin_channels']
Expand Down
4 changes: 2 additions & 2 deletions bert_vits2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ def __init__(self,
self.sdp = StochasticDurationPredictor(hidden_channels, 192, 3, 0.5, 4, gin_channels=gin_channels)
self.dp = DurationPredictor(hidden_channels, 256, 3, 0.5, gin_channels=gin_channels)

if n_speakers >= 1:
self.emb_g = nn.Embedding(n_speakers, gin_channels)
if self.n_speakers > 0:
self.emb_g = nn.Embedding(self.n_speakers, gin_channels)
else:
self.ref_enc = ReferenceEncoder(spec_channels, gin_channels)

Expand Down

0 comments on commit 893ee70

Please sign in to comment.