From 84d9d9a2bc2f698eb4e83d2d2cb12e0d53e8993c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Tue, 4 Jun 2024 21:39:56 +0900 Subject: [PATCH] fix(config): restrict CPUConfig --- configs/config.py | 7 ++----- infer/modules/vc/hash.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/configs/config.py b/configs/config.py index ac5ed4f..2942ce8 100644 --- a/configs/config.py +++ b/configs/config.py @@ -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 diff --git a/infer/modules/vc/hash.py b/infer/modules/vc/hash.py index eec8bd4..b1a5fd9 100644 --- a/infer/modules/vc/hash.py +++ b/infer/modules/vc/hash.py @@ -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,