Skip to content

Commit

Permalink
Merge pull request #793 from IAHispano/formatter/main
Browse files Browse the repository at this point in the history
chore(format): run black on main
  • Loading branch information
blaisewf authored Oct 7, 2024
2 parents e866b2a + 51cd7f4 commit dc447ee
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions rvc/train/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,15 @@ def run(
# get the first sample as reference for tensorboard evaluation
for info in train_loader:
phone, phone_lengths, pitch, pitchf, _, _, _, _, sid = info
reference = (phone.to(device),
phone_lengths.to(device),
pitch.to(device) if pitch_guidance else None,
pitchf.to(device) if pitch_guidance else None,
sid.to(device))
reference = (
phone.to(device),
phone_lengths.to(device),
pitch.to(device) if pitch_guidance else None,
pitchf.to(device) if pitch_guidance else None,
sid.to(device),
)
break

for epoch in range(epoch_str, total_epoch + 1):
if rank == 0:
train_and_evaluate(
Expand All @@ -514,7 +516,7 @@ def run(
custom_save_every_weights,
custom_total_epoch,
device,
reference
reference,
)
else:
train_and_evaluate(
Expand Down Expand Up @@ -791,10 +793,10 @@ def train_and_evaluate(
),
"all/mel": plot_spectrogram_to_numpy(mel[0].data.cpu().numpy()),
}

with torch.no_grad():
o, *_ = net_g.infer(*reference)
audio_dict = {f"gen/audio_{global_step:07d}": o[0, :, : ]}
audio_dict = {f"gen/audio_{global_step:07d}": o[0, :, :]}

summarize(
writer=writer,
Expand Down

0 comments on commit dc447ee

Please sign in to comment.