Sin2pi commited on
Commit
08be513
·
verified ·
1 Parent(s): 3542ded

Update model.py

Browse files
Files changed (1) hide show
  1. model.py +1 -1
model.py CHANGED
@@ -349,7 +349,7 @@ class rotary(nn.Module):
349
  def update_base(self, pitch):
350
  theta = pitch.squeeze(0).to(device, dtype)
351
  f0_mean = theta.mean() + 1e-8
352
- inv_freq = 1.0 / (f0_mean ** (torch.arange(start=0, end=self.dim, step=2, device=device, dtype=dtype) / self.dim))
353
  self.inv_freq.data.copy_(inv_freq)
354
  self.theta.data.copy_(f0_mean)
355
 
 
349
  def update_base(self, pitch):
350
  theta = pitch.squeeze(0).to(device, dtype)
351
  f0_mean = theta.mean() + 1e-8
352
+ inv_freq = 700 * (torch.pow(10, torch.linspace(0, 2595 * torch.log10(torch.tensor(1 + 8000/700)), dim // 2, device=device, dtype=dtype) / 2595) - 1) / 1000
353
  self.inv_freq.data.copy_(inv_freq)
354
  self.theta.data.copy_(f0_mean)
355