Skip to content

Commit 047d075

Browse files
committed
fix: 兼容 cosyvoice yaml 配置文件名 #268
1 parent 79ad238 commit 047d075

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

modules/core/models/tts/CosyVoiceModel.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ def load(
100100
# instruct = True if "-Instruct" in str(model_dir) else False
101101
instruct = True
102102

103-
with open(model_dir / "cosyvoice.yaml", "r") as f:
103+
# 具体看 #268 ,因为 cosyvoice 改动配置文件名,所以兼容两种情况
104+
configure_path_1 = model_dir / "cosyvoice.yaml"
105+
configure_path_2 = model_dir / "cosyvoice2.yaml"
106+
configure_path = (
107+
configure_path_1 if configure_path_1.exists() else configure_path_2
108+
)
109+
110+
with open(configure_path, "r") as f:
104111
configs = load_hyperpyyaml(f, overrides=self.hp_overrides)
105112

106113
frontend = CosyVoiceFrontEnd(

scripts/downloader/cosyvoice2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self):
1010
required_files = [
1111
"campplus.onnx",
1212
"configuration.json",
13-
"cosyvoice.yaml",
13+
"cosyvoice2.yaml",
1414
"flow.pt",
1515
"hift.pt",
1616
"llm.pt",

0 commit comments

Comments
 (0)