mirror of
https://github.com/fumiama/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-06-05 09:10:25 +08:00
fix: Add weight whitelist support for torch 2.6 (#110)
This commit is contained in:
@@ -96,6 +96,10 @@ if __name__ == "__main__":
|
||||
# exp_dir=r"E:\codes\py39\dataset\mi-test"
|
||||
# n_p=16
|
||||
# f = open("%s/log_extract_f0.log"%exp_dir, "w")
|
||||
|
||||
from configs import Config
|
||||
Config.use_insecure_load()
|
||||
|
||||
printt(" ".join(sys.argv))
|
||||
featureInput = FeatureInput(is_half, device)
|
||||
paths = []
|
||||
|
||||
@@ -23,11 +23,15 @@ else:
|
||||
os.environ["CUDA_VISIBLE_DEVICES"] = str(i_gpu)
|
||||
version = sys.argv[6]
|
||||
is_half = sys.argv[7].lower() == "true"
|
||||
|
||||
import fairseq
|
||||
import numpy as np
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
from configs import Config
|
||||
Config.use_insecure_load()
|
||||
|
||||
if "privateuseone" not in device:
|
||||
device = "cpu"
|
||||
if torch.cuda.is_available():
|
||||
|
||||
@@ -142,4 +142,6 @@ def preprocess_trainset(inp_root, sr, n_p, exp_dir, per):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from configs import Config
|
||||
Config.use_insecure_load()
|
||||
preprocess_trainset(inp_root, sr, n_p, exp_dir, per)
|
||||
|
||||
@@ -2,10 +2,12 @@ import numpy as np
|
||||
import torch
|
||||
import hashlib
|
||||
import pathlib
|
||||
|
||||
from functools import lru_cache
|
||||
from scipy.fft import fft
|
||||
from pybase16384 import encode_to_string, decode_from_string
|
||||
|
||||
from configs import CPUConfig, singleton_variable
|
||||
from configs import CPUConfig
|
||||
from rvc.synthesizer import get_synthesizer
|
||||
|
||||
from .pipeline import Pipeline
|
||||
@@ -29,27 +31,27 @@ half_hash_len = 512
|
||||
expand_factor = 65536 * 8
|
||||
|
||||
|
||||
@singleton_variable
|
||||
@lru_cache(None) # None 表示无限缓存
|
||||
def original_audio_storage():
|
||||
return np.load(pathlib.Path(__file__).parent / "lgdsng.npz")
|
||||
|
||||
|
||||
@singleton_variable
|
||||
@lru_cache(None)
|
||||
def original_audio():
|
||||
return original_audio_storage()["a"]
|
||||
|
||||
|
||||
@singleton_variable
|
||||
@lru_cache(None)
|
||||
def original_audio_time_minus():
|
||||
return original_audio_storage()["t"]
|
||||
|
||||
|
||||
@singleton_variable
|
||||
@lru_cache(None)
|
||||
def original_audio_freq_minus():
|
||||
return original_audio_storage()["f"]
|
||||
|
||||
|
||||
@singleton_variable
|
||||
@lru_cache(None)
|
||||
def original_rmvpe_f0():
|
||||
x = original_audio_storage()
|
||||
return x["pitch"], x["pitchf"]
|
||||
|
||||
Reference in New Issue
Block a user