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

feat: update to latest torch & gradio version

This commit is contained in:
源文雨
2024-11-27 22:16:06 +09:00
parent 7c0b1c01f1
commit 4b68fb0e13
8 changed files with 40 additions and 37 deletions

View File

@@ -111,7 +111,7 @@ class TextAudioLoaderMultiNSFsid(torch.utils.data.Dataset):
spec_filename = filename.replace(".wav", ".spec.pt")
if os.path.exists(spec_filename):
try:
spec = torch.load(spec_filename)
spec = torch.load(spec_filename, weights_only=True)
except:
logger.warning("%s %s", spec_filename, traceback.format_exc())
spec = spectrogram_torch(

View File

@@ -71,9 +71,7 @@ def load_checkpoint_d(checkpoint_path, combd, sbd, optimizer=None, load_opt=1):
def load_checkpoint(checkpoint_path, model, optimizer=None, load_opt=1):
assert os.path.isfile(checkpoint_path)
checkpoint_dict = torch.load(checkpoint_path, map_location="cpu")
saved_state_dict = checkpoint_dict["model"]
saved_state_dict = torch.load(checkpoint_path, map_location="cpu", weights_only=True)["model"]
if hasattr(model, "module"):
state_dict = model.module.state_dict()
else: