mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-19 08:19:47 +08:00
feat: fallback when ckpt not exists
This commit is contained in:
parent
968952fd2a
commit
33b63d3e2a
@ -73,6 +73,39 @@ with open("./weight.json", "r", encoding="utf-8") as file:
|
|||||||
if isinstance(sovits_path, list):
|
if isinstance(sovits_path, list):
|
||||||
sovits_path = sovits_path[0]
|
sovits_path = sovits_path[0]
|
||||||
|
|
||||||
|
if not gpt_path or not os.path.exists(gpt_path):
|
||||||
|
for path in pretrained_gpt_name:
|
||||||
|
if os.path.exists(path):
|
||||||
|
resolved_gpt_path = path
|
||||||
|
break
|
||||||
|
if resolved_gpt_path:
|
||||||
|
print(
|
||||||
|
f"GPT path '{gpt_path}' not found. Falling back to: '{resolved_gpt_path}'"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
f"GPT path '{gpt_path}' not found, and no pretrained GPT model found."
|
||||||
|
)
|
||||||
|
exit(1)
|
||||||
|
gpt_path = resolved_gpt_path
|
||||||
|
|
||||||
|
if not sovits_path or not os.path.exists(sovits_path):
|
||||||
|
for path in pretrained_sovits_name:
|
||||||
|
if os.path.exists(path):
|
||||||
|
resolved_sovits_path = path
|
||||||
|
break
|
||||||
|
if resolved_sovits_path:
|
||||||
|
print(
|
||||||
|
f"SoVITS path '{sovits_path}' not found. Falling back to: '{resolved_sovits_path}'"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
print(
|
||||||
|
f"SoVITS path '{sovits_path}' not found, and no pretrained SoVITS model found."
|
||||||
|
)
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
sovits_path = resolved_sovits_path
|
||||||
|
|
||||||
# gpt_path = os.environ.get(
|
# gpt_path = os.environ.get(
|
||||||
# "gpt_path", pretrained_gpt_name
|
# "gpt_path", pretrained_gpt_name
|
||||||
# )
|
# )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user