mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2025-02-07 06:02:49 +08:00
chore(format): run black on dev (#1619)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
d269d14768
commit
0f8a5facd9
@ -62,6 +62,7 @@ class RVC:
|
|||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if config.dml == True:
|
if config.dml == True:
|
||||||
|
|
||||||
def forward_dml(ctx, x, scale):
|
def forward_dml(ctx, x, scale):
|
||||||
ctx.scale = scale
|
ctx.scale = scale
|
||||||
res = x.clone().detach()
|
res = x.clone().detach()
|
||||||
@ -328,14 +329,20 @@ class RVC:
|
|||||||
def get_f0_fcpe(self, x, f0_up_key):
|
def get_f0_fcpe(self, x, f0_up_key):
|
||||||
if hasattr(self, "model_fcpe") == False:
|
if hasattr(self, "model_fcpe") == False:
|
||||||
from torchfcpe import spawn_bundled_infer_model
|
from torchfcpe import spawn_bundled_infer_model
|
||||||
|
|
||||||
printt("Loading fcpe model")
|
printt("Loading fcpe model")
|
||||||
self.model_fcpe = spawn_bundled_infer_model(self.device)
|
self.model_fcpe = spawn_bundled_infer_model(self.device)
|
||||||
f0 = self.model_fcpe.infer(
|
f0 = (
|
||||||
|
self.model_fcpe.infer(
|
||||||
torch.from_numpy(x).to(self.device).unsqueeze(0).float(),
|
torch.from_numpy(x).to(self.device).unsqueeze(0).float(),
|
||||||
sr=16000,
|
sr=16000,
|
||||||
decoder_mode='local_argmax',
|
decoder_mode="local_argmax",
|
||||||
threshold=0.006,
|
threshold=0.006,
|
||||||
).squeeze().cpu().numpy()
|
)
|
||||||
|
.squeeze()
|
||||||
|
.cpu()
|
||||||
|
.numpy()
|
||||||
|
)
|
||||||
f0 *= pow(2, f0_up_key / 12)
|
f0 *= pow(2, f0_up_key / 12)
|
||||||
return self.get_f0_post(f0)
|
return self.get_f0_post(f0)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user