From b708ae240a415b2393cf89701433ab9b57e786c9 Mon Sep 17 00:00:00 2001 From: OedoSoldier <31711261+OedoSoldier@users.noreply.github.com> Date: Sat, 28 Oct 2023 12:19:01 +0800 Subject: [PATCH] Fix incorrect config train_path and val_path (#125) --- preprocess_text.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/preprocess_text.py b/preprocess_text.py index 3aebbfe..1167277 100644 --- a/preprocess_text.py +++ b/preprocess_text.py @@ -69,6 +69,7 @@ def preprocess( ) ) except Exception as e: + print(line) print(f"生成训练集和验证集时发生错误!, 详细信息:\n{e}") transcription_path = cleaned_path @@ -124,12 +125,12 @@ def preprocess( json_config["data"]["spk2id"] = spk_id_map # 新增写入:写入训练版本、数据集路径 json_config["version"] = latest_version - json_config["data"]["training_files"] = os.path.normpath( - preprocess_text_config.train_path - ).replace("\\", "/") - json_config["data"]["validation_files"] = os.path.normpath( - preprocess_text_config.val_path - ).replace("\\", "/") + json_config["data"]["training_files"] = os.path.normpath(train_path).replace( + "\\", "/" + ) + json_config["data"]["validation_files"] = os.path.normpath(val_path).replace( + "\\", "/" + ) with open(config_path, "w", encoding="utf-8") as f: json.dump(json_config, f, indent=2, ensure_ascii=False) print("训练集和验证集生成完成!")