mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-08 03:55:47 +08:00
chore(format): run black on dev (#2106)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
0d2189fdeb
commit
a322e706f9
@@ -1,5 +1,6 @@
|
|||||||
import torch
|
import torch
|
||||||
|
|
||||||
|
|
||||||
def get_synthesizer_ckpt(cpt, device=torch.device("cpu")):
|
def get_synthesizer_ckpt(cpt, device=torch.device("cpu")):
|
||||||
from infer.lib.infer_pack.models import (
|
from infer.lib.infer_pack.models import (
|
||||||
SynthesizerTrnMs256NSFsid,
|
SynthesizerTrnMs256NSFsid,
|
||||||
@@ -35,7 +36,9 @@ def get_synthesizer_ckpt(cpt, device=torch.device("cpu")):
|
|||||||
net_g.remove_weight_norm()
|
net_g.remove_weight_norm()
|
||||||
return net_g, cpt
|
return net_g, cpt
|
||||||
|
|
||||||
|
|
||||||
def get_synthesizer(pth_path, device=torch.device("cpu")):
|
def get_synthesizer(pth_path, device=torch.device("cpu")):
|
||||||
return get_synthesizer_ckpt(
|
return get_synthesizer_ckpt(
|
||||||
torch.load(pth_path, map_location=torch.device("cpu")), device,
|
torch.load(pth_path, map_location=torch.device("cpu")),
|
||||||
|
device,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ class VC:
|
|||||||
elif torch.backends.mps.is_available():
|
elif torch.backends.mps.is_available():
|
||||||
torch.mps.empty_cache()
|
torch.mps.empty_cache()
|
||||||
###楼下不这么折腾清理不干净
|
###楼下不这么折腾清理不干净
|
||||||
self.net_g, self.cpt = get_synthesizer_ckpt(self.cpt, self.config.device)
|
self.net_g, self.cpt = get_synthesizer_ckpt(
|
||||||
|
self.cpt, self.config.device
|
||||||
|
)
|
||||||
self.if_f0 = self.cpt.get("f0", 1)
|
self.if_f0 = self.cpt.get("f0", 1)
|
||||||
self.version = self.cpt.get("version", "v1")
|
self.version = self.cpt.get("version", "v1")
|
||||||
del self.net_g, self.cpt
|
del self.net_g, self.cpt
|
||||||
|
|||||||
Reference in New Issue
Block a user