Fix incorrect config train_path and val_path (#125)
This commit is contained in:
@@ -69,6 +69,7 @@ def preprocess(
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
print(line)
|
||||||
print(f"生成训练集和验证集时发生错误!, 详细信息:\n{e}")
|
print(f"生成训练集和验证集时发生错误!, 详细信息:\n{e}")
|
||||||
|
|
||||||
transcription_path = cleaned_path
|
transcription_path = cleaned_path
|
||||||
@@ -124,12 +125,12 @@ def preprocess(
|
|||||||
json_config["data"]["spk2id"] = spk_id_map
|
json_config["data"]["spk2id"] = spk_id_map
|
||||||
# 新增写入:写入训练版本、数据集路径
|
# 新增写入:写入训练版本、数据集路径
|
||||||
json_config["version"] = latest_version
|
json_config["version"] = latest_version
|
||||||
json_config["data"]["training_files"] = os.path.normpath(
|
json_config["data"]["training_files"] = os.path.normpath(train_path).replace(
|
||||||
preprocess_text_config.train_path
|
"\\", "/"
|
||||||
).replace("\\", "/")
|
)
|
||||||
json_config["data"]["validation_files"] = os.path.normpath(
|
json_config["data"]["validation_files"] = os.path.normpath(val_path).replace(
|
||||||
preprocess_text_config.val_path
|
"\\", "/"
|
||||||
).replace("\\", "/")
|
)
|
||||||
with open(config_path, "w", encoding="utf-8") as f:
|
with open(config_path, "w", encoding="utf-8") as f:
|
||||||
json.dump(json_config, f, indent=2, ensure_ascii=False)
|
json.dump(json_config, f, indent=2, ensure_ascii=False)
|
||||||
print("训练集和验证集生成完成!")
|
print("训练集和验证集生成完成!")
|
||||||
|
|||||||
Reference in New Issue
Block a user