mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2025-08-27 23:58:03 +08:00
change config
This commit is contained in:
parent
aa020b059d
commit
778a43760a
@ -97,7 +97,6 @@ class TTS_Config:
|
|||||||
configs = yaml.load(f, Loader=yaml.FullLoader)
|
configs = yaml.load(f, Loader=yaml.FullLoader)
|
||||||
|
|
||||||
return configs
|
return configs
|
||||||
|
|
||||||
|
|
||||||
def save_configs(self, configs_path:str=None)->None:
|
def save_configs(self, configs_path:str=None)->None:
|
||||||
configs={
|
configs={
|
||||||
@ -110,22 +109,27 @@ class TTS_Config:
|
|||||||
"bert_base_path": "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",
|
"bert_base_path": "GPT_SoVITS/pretrained_models/chinese-roberta-wwm-ext-large",
|
||||||
"flash_attn_enabled": True
|
"flash_attn_enabled": True
|
||||||
},
|
},
|
||||||
"custom": {
|
"custom": self.update_configs()
|
||||||
"device": str(self.device),
|
|
||||||
"is_half": self.is_half,
|
|
||||||
"t2s_weights_path": self.t2s_weights_path,
|
|
||||||
"vits_weights_path": self.vits_weights_path,
|
|
||||||
"bert_base_path": self.bert_base_path,
|
|
||||||
"cnhuhbert_base_path": self.cnhuhbert_base_path,
|
|
||||||
"flash_attn_enabled": self.flash_attn_enabled
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if configs_path is None:
|
if configs_path is None:
|
||||||
configs_path = self.configs_path
|
configs_path = self.configs_path
|
||||||
with open(configs_path, 'w') as f:
|
with open(configs_path, 'w') as f:
|
||||||
yaml.dump(configs, 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,
|
||||||
|
"vits_weights_path" : self.vits_weights_path,
|
||||||
|
"bert_base_path" : self.bert_base_path,
|
||||||
|
"cnhuhbert_base_path": self.cnhuhbert_base_path,
|
||||||
|
"flash_attn_enabled" : self.flash_attn_enabled
|
||||||
|
}
|
||||||
|
return config
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
self.configs = self.update_configs()
|
||||||
string = "TTS Config".center(100, '-') + '\n'
|
string = "TTS Config".center(100, '-') + '\n'
|
||||||
for k, v in self.configs.items():
|
for k, v in self.configs.items():
|
||||||
string += f"{str(k).ljust(20)}: {str(v)}\n"
|
string += f"{str(k).ljust(20)}: {str(v)}\n"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user