mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 15:19:59 +08:00
remove useless code
chores chores chores .
This commit is contained in:
parent
6332214f21
commit
eada712b23
@ -39,10 +39,6 @@ with open(f"./weight.json", 'r', encoding="utf-8") as file:
|
|||||||
"gpt_path", weight_data.get('GPT',{}).get(version,pretrained_gpt_name))
|
"gpt_path", weight_data.get('GPT',{}).get(version,pretrained_gpt_name))
|
||||||
sovits_path = os.environ.get(
|
sovits_path = os.environ.get(
|
||||||
"sovits_path", weight_data.get('SoVITS',{}).get(version,pretrained_sovits_name))
|
"sovits_path", weight_data.get('SoVITS',{}).get(version,pretrained_sovits_name))
|
||||||
|
|
||||||
# if len(sys.argv[1]==2) or len(sys.argv[1])==5:
|
|
||||||
# gpt_path = pretrained_gpt_name
|
|
||||||
# sovits_path = pretrained_sovits_name
|
|
||||||
|
|
||||||
# gpt_path = os.environ.get(
|
# gpt_path = os.environ.get(
|
||||||
# "gpt_path", pretrained_gpt_name
|
# "gpt_path", pretrained_gpt_name
|
||||||
@ -599,10 +595,12 @@ def change_choices():
|
|||||||
return {"choices": sorted(SoVITS_names, key=custom_sort_key), "__type__": "update"}, {"choices": sorted(GPT_names, key=custom_sort_key), "__type__": "update"}
|
return {"choices": sorted(SoVITS_names, key=custom_sort_key), "__type__": "update"}, {"choices": sorted(GPT_names, key=custom_sort_key), "__type__": "update"}
|
||||||
|
|
||||||
|
|
||||||
SoVITS_weight_root = f"SoVITS_weights/{version}"
|
SoVITS_weight_root="SoVITS_weights_v2" if version=='v2' else "SoVITS_weights"
|
||||||
GPT_weight_root = f"GPT_weights/{version}"
|
GPT_weight_root="GPT_weights_v2" if version=='v2' else "GPT_weights"
|
||||||
os.makedirs(SoVITS_weight_root, exist_ok=True)
|
os.makedirs("SoVITS_weights",exist_ok=True)
|
||||||
os.makedirs(GPT_weight_root, exist_ok=True)
|
os.makedirs("GPT_weights",exist_ok=True)
|
||||||
|
os.makedirs("SoVITS_weights_v2",exist_ok=True)
|
||||||
|
os.makedirs("GPT_weights_v2",exist_ok=True)
|
||||||
|
|
||||||
|
|
||||||
def get_weights_names():
|
def get_weights_names():
|
||||||
|
13
webui.py
13
webui.py
@ -1,6 +1,7 @@
|
|||||||
import os,shutil,sys,pdb,re
|
import os,shutil,sys,pdb,re
|
||||||
|
if len(sys.argv)==1:sys.argv.append('v1')
|
||||||
version="v2"if sys.argv[1]=="v2" else"v1"
|
version="v2"if sys.argv[1]=="v2" else"v1"
|
||||||
language=sys.argv[-1] if sys.argv[-1]!='v2' and sys.argv[-1]!='v1' else 'auto'
|
language=sys.argv[-1] if len(sys.argv[-1])==5 else "auto"
|
||||||
os.environ["version"]=version
|
os.environ["version"]=version
|
||||||
os.environ["language"]=language
|
os.environ["language"]=language
|
||||||
now_dir = os.getcwd()
|
now_dir = os.getcwd()
|
||||||
@ -121,10 +122,12 @@ def get_weights_names():
|
|||||||
for name in os.listdir(GPT_weight_root):
|
for name in os.listdir(GPT_weight_root):
|
||||||
if name.endswith(".ckpt"): GPT_names.append(name)
|
if name.endswith(".ckpt"): GPT_names.append(name)
|
||||||
return SoVITS_names,GPT_names
|
return SoVITS_names,GPT_names
|
||||||
SoVITS_weight_root=f"SoVITS_weights/{version}"
|
SoVITS_weight_root="SoVITS_weights_v2" if version=='v2' else "SoVITS_weights"
|
||||||
GPT_weight_root=f"GPT_weights/{version}"
|
GPT_weight_root="GPT_weights_v2" if version=='v2' else "GPT_weights"
|
||||||
os.makedirs(SoVITS_weight_root,exist_ok=True)
|
os.makedirs("SoVITS_weights",exist_ok=True)
|
||||||
os.makedirs(GPT_weight_root,exist_ok=True)
|
os.makedirs("GPT_weights",exist_ok=True)
|
||||||
|
os.makedirs("SoVITS_weights_v2",exist_ok=True)
|
||||||
|
os.makedirs("GPT_weights_v2",exist_ok=True)
|
||||||
SoVITS_names,GPT_names = get_weights_names()
|
SoVITS_names,GPT_names = get_weights_names()
|
||||||
|
|
||||||
def custom_sort_key(s):
|
def custom_sort_key(s):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user