mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-08 12:00:49 +08:00
fix: remove outdated codes & add weights_only=True
This commit is contained in:
@@ -59,7 +59,7 @@ def save_small_model(ckpt, sr, if_f0, name, epoch, version, hps):
|
||||
|
||||
def extract_small_model(path, name, author, sr, if_f0, info, version):
|
||||
try:
|
||||
ckpt = torch.load(path, map_location="cpu")
|
||||
ckpt = torch.load(path, map_location="cpu", weights_only=True)
|
||||
if "model" in ckpt:
|
||||
ckpt = ckpt["model"]
|
||||
opt = OrderedDict()
|
||||
@@ -196,7 +196,7 @@ def extract_small_model(path, name, author, sr, if_f0, info, version):
|
||||
|
||||
def change_info(path, info, name):
|
||||
try:
|
||||
ckpt = torch.load(path, map_location="cpu")
|
||||
ckpt = torch.load(path, map_location="cpu", weights_only=True)
|
||||
ckpt["info"] = info
|
||||
if name == "":
|
||||
name = os.path.basename(path)
|
||||
@@ -229,8 +229,8 @@ def merge(path1, path2, alpha1, sr, f0, info, name, version):
|
||||
a2 = "Unknown"
|
||||
return f"{a1} & {a2}"
|
||||
|
||||
ckpt1 = torch.load(path1, map_location="cpu")
|
||||
ckpt2 = torch.load(path2, map_location="cpu")
|
||||
ckpt1 = torch.load(path1, map_location="cpu", weights_only=True)
|
||||
ckpt2 = torch.load(path2, map_location="cpu", weights_only=True)
|
||||
cfg = ckpt1["config"]
|
||||
if "model" in ckpt1:
|
||||
ckpt1 = extract(ckpt1)
|
||||
|
||||
Reference in New Issue
Block a user