change config

This commit is contained in:
SapphireLab 2024-03-11 13:53:56 +08:00
parent aa020b059d
commit 778a43760a

View File

@ -98,7 +98,6 @@ class TTS_Config:
return configs
def save_configs(self, configs_path:str=None)->None:
configs={
"default": {
@ -110,7 +109,15 @@ class TTS_Config:
"bert_base_path": "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",
"flash_attn_enabled": True
},
"custom": {
"custom": self.update_configs()
}
if configs_path is None:
configs_path = self.configs_path
with open(configs_path, 'w') as f:
yaml.dump(configs, f)
def update_configs(self):
config = {
"device" : str(self.device),
"is_half" : self.is_half,
"t2s_weights_path" : self.t2s_weights_path,
@ -119,13 +126,10 @@ class TTS_Config:
"cnhuhbert_base_path": self.cnhuhbert_base_path,
"flash_attn_enabled" : self.flash_attn_enabled
}
}
if configs_path is None:
configs_path = self.configs_path
with open(configs_path, 'w') as f:
yaml.dump(configs, f)
return config
def __str__(self):
self.configs = self.update_configs()
string = "TTS Config".center(100, '-') + '\n'
for k, v in self.configs.items():
string += f"{str(k).ljust(20)}: {str(v)}\n"