Update TTS.py
This commit is contained in:
@@ -304,7 +304,7 @@ class TTS:
|
|||||||
def init_vits_weights(self, weights_path: str):
|
def init_vits_weights(self, weights_path: str):
|
||||||
print(f"Loading VITS weights from {weights_path}")
|
print(f"Loading VITS weights from {weights_path}")
|
||||||
self.configs.vits_weights_path = weights_path
|
self.configs.vits_weights_path = weights_path
|
||||||
dict_s2 = torch.load(weights_path, map_location=self.configs.device)
|
dict_s2 = torch.load(weights_path, map_location=self.configs.device,weights_only=False)
|
||||||
hps = dict_s2["config"]
|
hps = dict_s2["config"]
|
||||||
if dict_s2['weight']['enc_p.text_embedding.weight'].shape[0] == 322:
|
if dict_s2['weight']['enc_p.text_embedding.weight'].shape[0] == 322:
|
||||||
self.configs.update_version("v1")
|
self.configs.update_version("v1")
|
||||||
@@ -1031,4 +1031,4 @@ def speed_change(input_audio:np.ndarray, speed:float, sr:int):
|
|||||||
# 将管道输出解码为 NumPy 数组
|
# 将管道输出解码为 NumPy 数组
|
||||||
processed_audio = np.frombuffer(out, np.int16)
|
processed_audio = np.frombuffer(out, np.int16)
|
||||||
|
|
||||||
return processed_audio
|
return processed_audio
|
||||||
|
|||||||
Reference in New Issue
Block a user