1
0
mirror of https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git synced 2026-06-11 21:50:24 +08:00

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

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2024-06-10 21:38:19 +09:00
committed by GitHub
parent e33ef19200
commit fe7a2bf41a
3 changed files with 27 additions and 18 deletions

View File

@@ -212,7 +212,7 @@ class SynthesizerTrnMsNSFsid(nn.Module):
# n_res=return_length2 # n_res=return_length2
) )
del x_mask, z 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): class SynthesizerTrnMs256NSFsid(SynthesizerTrnMsNSFsid):

View File

@@ -428,15 +428,19 @@ class RVC:
# return_length2 = torch.LongTensor([return_length2]) # return_length2 = torch.LongTensor([return_length2])
return_length = torch.LongTensor([return_length]) return_length = torch.LongTensor([return_length])
with torch.no_grad(): with torch.no_grad():
infered_audio = self.net_g.infer( infered_audio = (
feats, self.net_g.infer(
p_len, feats,
sid, p_len,
pitch=cache_pitch, sid,
pitchf=cache_pitchf, pitch=cache_pitch,
skip_head=skip_head, pitchf=cache_pitchf,
return_length=return_length, skip_head=skip_head,
).squeeze(1).float() return_length=return_length,
)
.squeeze(1)
.float()
)
upp_res = int(np.floor(factor * self.tgt_sr // 100)) upp_res = int(np.floor(factor * self.tgt_sr // 100))
if upp_res != self.tgt_sr // 100: if upp_res != self.tgt_sr // 100:
if upp_res not in self.resample_kernel: if upp_res not in self.resample_kernel:

View File

@@ -291,14 +291,19 @@ class Pipeline(object):
p_len = torch.tensor([p_len], device=self.device).long() p_len = torch.tensor([p_len], device=self.device).long()
with torch.no_grad(): with torch.no_grad():
audio1 = ( audio1 = (
net_g.infer( (
feats, net_g.infer(
p_len, feats,
sid, p_len,
pitch=pitch, sid,
pitchf=pitchf, pitch=pitch,
)[0, 0] pitchf=pitchf,
).data.cpu().float().numpy() )[0, 0]
)
.data.cpu()
.float()
.numpy()
)
del feats, p_len, padding_mask del feats, p_len, padding_mask
if torch.cuda.is_available(): if torch.cuda.is_available():
torch.cuda.empty_cache() torch.cuda.empty_cache()