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 (#40)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
54f7ae097d
commit
b4f7bbbe39
@@ -62,9 +62,7 @@ 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(
|
self.net_g, self.cpt = get_synthesizer(self.cpt, self.config.device)
|
||||||
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
|
||||||
|
|||||||
@@ -262,9 +262,7 @@ def apply_mask(self, x, padding_mask, target_list):
|
|||||||
return x, mask_indices
|
return x, mask_indices
|
||||||
|
|
||||||
|
|
||||||
def get_hubert(
|
def get_hubert(model_path="assets/hubert/hubert_base.pt", device=torch.device("cpu")):
|
||||||
model_path="assets/hubert/hubert_base.pt", device=torch.device("cpu")
|
|
||||||
):
|
|
||||||
models, _, _ = load_model_ensemble_and_task(
|
models, _, _ = load_model_ensemble_and_task(
|
||||||
[model_path],
|
[model_path],
|
||||||
suffix="",
|
suffix="",
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ def get_synthesizer(cpt: OrderedDict, device=torch.device("cpu")):
|
|||||||
|
|
||||||
|
|
||||||
def load_synthesizer(
|
def load_synthesizer(
|
||||||
pth_path: torch.serialization.FILE_LIKE, device=torch.device("cpu")):
|
pth_path: torch.serialization.FILE_LIKE, device=torch.device("cpu")
|
||||||
|
):
|
||||||
return get_synthesizer(
|
return get_synthesizer(
|
||||||
torch.load(pth_path, map_location=torch.device("cpu")),
|
torch.load(pth_path, map_location=torch.device("cpu")),
|
||||||
device,
|
device,
|
||||||
|
|||||||
Reference in New Issue
Block a user