From fe7a2bf41a03d933f18202f46f8fc29b7afbb284 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 21:38:19 +0900 Subject: [PATCH] chore(format): run black on dev (#23) Co-authored-by: github-actions[bot] --- infer/lib/infer_pack/models.py | 2 +- infer/lib/rtrvc.py | 22 +++++++++++++--------- infer/modules/vc/pipeline.py | 21 +++++++++++++-------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/infer/lib/infer_pack/models.py b/infer/lib/infer_pack/models.py index 304c367..76b4a64 100644 --- a/infer/lib/infer_pack/models.py +++ b/infer/lib/infer_pack/models.py @@ -212,7 +212,7 @@ class SynthesizerTrnMsNSFsid(nn.Module): # n_res=return_length2 ) del x_mask, z - return o # , x_mask, (z, z_p, m_p, logs_p) + return o # , x_mask, (z, z_p, m_p, logs_p) class SynthesizerTrnMs256NSFsid(SynthesizerTrnMsNSFsid): diff --git a/infer/lib/rtrvc.py b/infer/lib/rtrvc.py index dfe7e28..7fc9dae 100644 --- a/infer/lib/rtrvc.py +++ b/infer/lib/rtrvc.py @@ -428,15 +428,19 @@ class RVC: # return_length2 = torch.LongTensor([return_length2]) return_length = torch.LongTensor([return_length]) with torch.no_grad(): - infered_audio = self.net_g.infer( - feats, - p_len, - sid, - pitch=cache_pitch, - pitchf=cache_pitchf, - skip_head=skip_head, - return_length=return_length, - ).squeeze(1).float() + infered_audio = ( + self.net_g.infer( + feats, + p_len, + sid, + pitch=cache_pitch, + pitchf=cache_pitchf, + skip_head=skip_head, + return_length=return_length, + ) + .squeeze(1) + .float() + ) upp_res = int(np.floor(factor * self.tgt_sr // 100)) if upp_res != self.tgt_sr // 100: if upp_res not in self.resample_kernel: diff --git a/infer/modules/vc/pipeline.py b/infer/modules/vc/pipeline.py index f3ec6ba..fb42cd8 100644 --- a/infer/modules/vc/pipeline.py +++ b/infer/modules/vc/pipeline.py @@ -291,14 +291,19 @@ class Pipeline(object): p_len = torch.tensor([p_len], device=self.device).long() with torch.no_grad(): audio1 = ( - net_g.infer( - feats, - p_len, - sid, - pitch=pitch, - pitchf=pitchf, - )[0, 0] - ).data.cpu().float().numpy() + ( + net_g.infer( + feats, + p_len, + sid, + pitch=pitch, + pitchf=pitchf, + )[0, 0] + ) + .data.cpu() + .float() + .numpy() + ) del feats, p_len, padding_mask if torch.cuda.is_available(): torch.cuda.empty_cache()