Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BenAAndrew committed Feb 6, 2022
1 parent b5b8438 commit c62fdd0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions application/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,10 +452,10 @@ def label_clip():

# Update dataset size
update_dataset_info(
os.path.join(paths["datasets"], dataset, METADATA_FILE),
os.path.join(paths["datasets"], dataset, METADATA_FILE),
os.path.join(paths["datasets"], dataset, INFO_FILE),
os.path.join(paths["datasets"], dataset, UNLABELLED_FOLDER, clip),
text
text,
)

# Add to metadata
Expand Down
4 changes: 2 additions & 2 deletions synthesis/vocoders/hifigan_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, h):
self.ups.append(
weight_norm(
ConvTranspose1d(
h.upsample_initial_channel // (2 ** i),
h.upsample_initial_channel // (2**i),
h.upsample_initial_channel // (2 ** (i + 1)),
k,
u,
Expand Down Expand Up @@ -358,7 +358,7 @@ def discriminator_loss(disc_real_outputs, disc_generated_outputs):
g_losses = []
for dr, dg in zip(disc_real_outputs, disc_generated_outputs):
r_loss = torch.mean((1 - dr) ** 2)
g_loss = torch.mean(dg ** 2)
g_loss = torch.mean(dg**2)
loss += r_loss + g_loss
r_losses.append(r_loss.item())
g_losses.append(g_loss.item())
Expand Down
2 changes: 1 addition & 1 deletion tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_update_dataset_info():

with open(info_path) as f:
info_before = json.load(f)

update_dataset_info(metadata_path, info_path, clip_path, text)

with open(info_path) as f:
Expand Down
4 changes: 2 additions & 2 deletions training/hifigan/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def __init__(self, h):
self.ups.append(
weight_norm(
ConvTranspose1d(
h.upsample_initial_channel // (2 ** i),
h.upsample_initial_channel // (2**i),
h.upsample_initial_channel // (2 ** (i + 1)),
k,
u,
Expand Down Expand Up @@ -359,7 +359,7 @@ def discriminator_loss(disc_real_outputs, disc_generated_outputs):
g_losses = []
for dr, dg in zip(disc_real_outputs, disc_generated_outputs):
r_loss = torch.mean((1 - dr) ** 2)
g_loss = torch.mean(dg ** 2)
g_loss = torch.mean(dg**2)
loss += r_loss + g_loss
r_losses.append(r_loss.item())
g_losses.append(g_loss.item())
Expand Down
2 changes: 1 addition & 1 deletion training/tacotron2_model/stft.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def transform(self, input_data):
real_part = forward_transform[:, :cutoff, :]
imag_part = forward_transform[:, cutoff:, :]

magnitude = torch.sqrt(real_part ** 2 + imag_part ** 2)
magnitude = torch.sqrt(real_part**2 + imag_part**2)
phase = torch.autograd.Variable(torch.atan2(imag_part.data, real_part.data))

return magnitude, phase
Expand Down

0 comments on commit c62fdd0

Please sign in to comment.