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

fix-no-f0-model-protect-issue

fix-no-f0-model-protect-issue
This commit is contained in:
RVC-Boss
2023-06-18 15:17:36 +08:00
committed by GitHub
parent ec0c39d9bc
commit a9a77f2556
2 changed files with 16 additions and 11 deletions

View File

@@ -184,7 +184,7 @@ class VC(object):
with torch.no_grad():
logits = model.extract_features(**inputs)
feats = model.final_proj(logits[0]) if version == "v1" else logits[0]
if protect < 0.5:
if protect < 0.5 and pitch!=None and pitchf!=None:
feats0 = feats.clone()
if (
isinstance(index, type(None)) == False
@@ -211,7 +211,7 @@ class VC(object):
)
feats = F.interpolate(feats.permute(0, 2, 1), scale_factor=2).permute(0, 2, 1)
if protect < 0.5:
if protect < 0.5 and pitch!=None and pitchf!=None:
feats0 = F.interpolate(feats0.permute(0, 2, 1), scale_factor=2).permute(
0, 2, 1
)
@@ -223,7 +223,7 @@ class VC(object):
pitch = pitch[:, :p_len]
pitchf = pitchf[:, :p_len]
if protect < 0.5:
if protect < 0.5 and pitch!=None and pitchf!=None:
pitchff = pitchf.clone()
pitchff[pitchf > 0] = 1
pitchff[pitchf < 1] = protect