Compare commits

...

3 Commits

Author SHA1 Message Date
e1732a364fed
c2f9aaa34e
Merge a4323233c67133f33be2db180bef07dda1376e4d into ed89a023378dabba9d4b6580235bb9742245816d 2025-06-11 11:15:52 -04:00
RVC-Boss
ed89a02337
修复“修复ge.sum数值可能爆炸的”可能导致的训练爆炸的问题
修复“修复ge.sum数值可能爆炸的”可能导致的训练爆炸的问题
2025-06-11 23:14:52 +08:00
e1732a364fed
a4323233c6
Update TTS.py: +configs["version"] = self.version 2025-06-08 06:32:05 -07:00
2 changed files with 5 additions and 2 deletions

View File

@ -364,6 +364,7 @@ class TTS_Config:
configs = deepcopy(self.default_configs)
if self.configs is not None:
configs["custom"] = self.update_configs()
configs["version"] = self.version
if configs_path is None:
configs_path = self.configs_path

View File

@ -1,4 +1,6 @@
import math
import pdb
import numpy as np
import torch
from torch import nn
@ -716,11 +718,11 @@ class MelStyleEncoder(nn.Module):
if mask is None:
out = torch.mean(x, dim=1)
else:
len_ = (~mask).sum()
len_ = (~mask).sum(dim=1).unsqueeze(1)
x = x.masked_fill(mask.unsqueeze(-1), 0)
dtype=x.dtype
x = x.float()
x=torch.div(x,len_)
x=torch.div(x,len_.unsqueeze(1))
out=x.sum(dim=1).to(dtype)
return out