mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-10-07 15:19:59 +08:00
修正删除模型会报错的bug
This commit is contained in:
parent
fdc2df2170
commit
8eb3c556f9
@ -51,15 +51,19 @@ custom:
|
||||
|
||||
class TTS_Config:
|
||||
def __init__(self, configs: Union[dict, str]):
|
||||
configs_base_path:str = "GPT_SoVITS/configs/"
|
||||
os.makedirs(configs_base_path, exist_ok=True)
|
||||
self.configs_path:str = os.path.join(configs_base_path, "tts_infer.yaml")
|
||||
if isinstance(configs, str):
|
||||
self.configs_path = configs
|
||||
configs:dict = self._load_configs(configs)
|
||||
if isinstance(configs, str) and configs=="":
|
||||
self.default_configs:dict = None
|
||||
self.configs_path = "GPT_SoVITS/configs/tts_infer.yaml"
|
||||
else:
|
||||
configs_base_path:str = "GPT_SoVITS/configs/"
|
||||
os.makedirs(configs_base_path, exist_ok=True)
|
||||
self.configs_path:str = os.path.join(configs_base_path, "tts_infer.yaml")
|
||||
if isinstance(configs, str):
|
||||
self.configs_path = configs
|
||||
configs:dict = self._load_configs(configs)
|
||||
|
||||
# assert isinstance(configs, dict)
|
||||
self.default_configs:dict = configs.get("default", None)
|
||||
# assert isinstance(configs, dict)
|
||||
self.default_configs:dict = configs.get("default", None)
|
||||
if self.default_configs is None:
|
||||
self.default_configs={
|
||||
"device": "cpu",
|
||||
@ -70,7 +74,10 @@ class TTS_Config:
|
||||
"bert_base_path": "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",
|
||||
"flash_attn_enabled": True
|
||||
}
|
||||
self.configs:dict = configs.get("custom", self.default_configs)
|
||||
if isinstance(configs, dict):
|
||||
self.configs:dict = configs.get("custom", self.default_configs)
|
||||
else:
|
||||
self.configs:dict = self.default_configs
|
||||
|
||||
self.device = self.configs.get("device")
|
||||
self.is_half = self.configs.get("is_half")
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 6db34d726ae2d84ab7982865343bf966246e00d4
|
||||
Subproject commit 03326be908f0288ab8d26f435eca2ca1ec950b90
|
@ -1,4 +1,8 @@
|
||||
{
|
||||
"deflaut_character": "胡桃(测试)"
|
||||
|
||||
"deflaut_character": "胡桃(测试)",
|
||||
"characters_and_emotions": {
|
||||
"胡桃(测试)": [
|
||||
"default"
|
||||
]
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user