Fix incorrect config train_path and val_path (#125)

This commit is contained in:
OedoSoldier
2023-10-28 12:19:01 +08:00
committed by GitHub
parent 82ae8f6928
commit b708ae240a

View File

@@ -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("训练集和验证集生成完成!")