fix(config): restrict CPUConfig

This commit is contained in:
源文雨 2024-06-04 21:39:56 +09:00
parent 8ed0dec181
commit 84d9d9a2bc
2 changed files with 3 additions and 6 deletions

View File

@ -270,7 +270,7 @@ class CPUConfig:
self.device = "cpu"
self.is_half = False
self.use_jit = False
self.n_cpu = 0
self.n_cpu = 1
self.gpu_name = None
self.json_config = self.load_config_json()
self.gpu_mem = None
@ -282,10 +282,7 @@ class CPUConfig:
def load_config_json() -> dict:
d = {}
for config_file in version_config_list:
p = f"configs/inuse/{config_file}"
if not os.path.exists(p):
shutil.copy(f"configs/{config_file}", p)
with open(f"configs/inuse/{config_file}", "r") as f:
with open(f"configs/{config_file}", "r") as f:
d[config_file] = json.load(f)
return d

View File

@ -136,7 +136,7 @@ def model_hash_ckpt(cpt):
with TorchSeedContext(114514):
tgt_sr = cpt["config"][-1]
if_f0 = cpt.get("f0", 1)
if_f0 = 0
version = cpt.get("version", "v1")
synthesizer_class = {
("v1", 1): SynthesizerTrnMs256NSFsid,