Skip to content

Commit 4fbf0bb

Browse files
committed
fix voice clone use default model error in same case
1 parent 3ab1f46 commit 4fbf0bb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/easevoice/inference/tts.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ def get_path(key: str):
118118
return path
119119

120120
self.t2s_weights_path = get_path("t2s_weights_path")
121+
self.default_t2s_weights_path = global_config.gpt_path
122+
121123
self.vits_weights_path = get_path("vits_weights_path")
124+
self.default_vits_weights_path = global_config.sovits_path
125+
122126
self.bert_base_path = get_path("bert_base_path")
123127
self.cnhuhbert_base_path = get_path("cnhuhbert_base_path")
124128

@@ -223,8 +227,8 @@ def update_weights(self, sovits_path: str, gpt_path: str):
223227
if sovits_path != self.current_sovits_path:
224228
if sovits_path == "":
225229
# empty sovits path, use default path
226-
if self.current_sovits_path != self.configs.vits_weights_path:
227-
self.current_sovits_path = self.configs.vits_weights_path
230+
if self.current_sovits_path != self.configs.default_vits_weights_path:
231+
self.current_sovits_path = self.configs.default_vits_weights_path
228232
self.init_vits_weights(self.current_sovits_path)
229233
else:
230234
self.current_sovits_path = sovits_path
@@ -233,8 +237,8 @@ def update_weights(self, sovits_path: str, gpt_path: str):
233237
if gpt_path != self.current_gpt_path:
234238
if gpt_path == "":
235239
# empty gpt path, use default path
236-
if self.current_gpt_path != self.configs.t2s_weights_path:
237-
self.current_gpt_path = self.configs.t2s_weights_path
240+
if self.current_gpt_path != self.configs.default_t2s_weights_path:
241+
self.current_gpt_path = self.configs.default_t2s_weights_path
238242
self.init_t2s_weights(self.current_gpt_path)
239243
else:
240244
self.current_gpt_path = gpt_path

0 commit comments

Comments
 (0)