From 9483a6c5769eac34caa63d1a2deaa1825958ded6 Mon Sep 17 00:00:00 2001 From: Sora Date: Sat, 11 Nov 2023 20:28:31 +0800 Subject: [PATCH] Fix: roll back #170 and fix bug in api /tools/random_example (#177) --- server.py | 2 +- server_fastapi.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/server.py b/server.py index 192a678f3..d6eb57d72 100644 --- a/server.py +++ b/server.py @@ -50,7 +50,7 @@ def wav2(i, o, format): # 加载模型 models = config.server_config.models for model in models: - hps_List.append(utils.get_hparams_from_file(model["config_path"])) + hps_List.append(utils.get_hparams_from_file(model["config"])) # 添加角色字典 chrsMap.append(dict()) for name, cid in hps_List[-1].data.spk2id.items(): diff --git a/server_fastapi.py b/server_fastapi.py index ae1686922..a07db597a 100644 --- a/server_fastapi.py +++ b/server_fastapi.py @@ -163,7 +163,7 @@ def get_models(self): models_info = config.server_config.models for model_info in models_info: loaded_models.init_model( - config_path=model_info["config_path"], + config_path=model_info["config"], model_path=model_info["model"], device=model_info["device"], language=model_info["language"], @@ -550,7 +550,7 @@ def random_example( examples = all_examples[root_dir] # 从项目Data目录中搜索train/val.list - for root, directories, _files in os.walk("Data"): + for root, directories, _files in os.walk(root_dir): for file in _files: if file in ["train.list", "val.list"]: with open(