1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-05 01:10:22 +08:00

chore(format): run black on dev (#144)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-04-19 00:37:50 +08:00
committed by GitHub
parent f9ae0b5d32
commit a3a69e8bd5
3 changed files with 11 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ try:
except Exception:
pass
finally:
if not ('GradScaler' in globals() and 'autocast' in globals()):
if not ("GradScaler" in globals() and "autocast" in globals()):
from torch.amp.grad_scaler import GradScaler
from torch.amp.autocast_mode import autocast

View File

@@ -213,6 +213,7 @@ class PosteriorEncoder(nn.Module):
def __prepare_scriptable__(self):
from torch.nn.utils import parametrize
if parametrize.is_parametrized(self.enc, "weight"):
parametrize.remove_parametrizations(self.enc, "weight")
return self

View File

@@ -51,7 +51,9 @@ class WN(torch.nn.Module):
cond_layer = torch.nn.Conv1d(
gin_channels, 2 * hidden_channels * n_layers, 1
)
self.cond_layer = torch.nn.utils.parametrizations.weight_norm(cond_layer, name="weight")
self.cond_layer = torch.nn.utils.parametrizations.weight_norm(
cond_layer, name="weight"
)
for i in range(n_layers):
dilation = dilation_rate**i
@@ -63,7 +65,9 @@ class WN(torch.nn.Module):
dilation=dilation,
padding=padding,
)
in_layer = torch.nn.utils.parametrizations.weight_norm(in_layer, name="weight")
in_layer = torch.nn.utils.parametrizations.weight_norm(
in_layer, name="weight"
)
self.in_layers.append(in_layer)
# last one is not necessary
@@ -73,7 +77,9 @@ class WN(torch.nn.Module):
res_skip_channels = hidden_channels
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
res_skip_layer = torch.nn.utils.parametrizations.weight_norm(res_skip_layer, name="weight")
res_skip_layer = torch.nn.utils.parametrizations.weight_norm(
res_skip_layer, name="weight"
)
self.res_skip_layers.append(res_skip_layer)
def __call__(