aluminumbox commited on
Commit
cae2c8f
·
verified ·
1 Parent(s): fb3e12e

Update cosyvoice/transformer/convolution.py

Browse files
cosyvoice/transformer/convolution.py CHANGED
@@ -177,6 +177,7 @@ class CausalConv1d(torch.nn.Conv1d):
177
  input_timestep = x.shape[2]
178
  if cache.size(2) == 0:
179
  cache = torch.zeros(x.shape[0], x.shape[1], self.causal_padding).to(x)
 
180
  assert cache.size(2) == self.causal_padding
181
  if self.causal_type == 'left':
182
  x = torch.concat([cache, x], dim=2)
 
177
  input_timestep = x.shape[2]
178
  if cache.size(2) == 0:
179
  cache = torch.zeros(x.shape[0], x.shape[1], self.causal_padding).to(x)
180
+ cache = cache.to(x)
181
  assert cache.size(2) == self.causal_padding
182
  if self.causal_type == 'left':
183
  x = torch.concat([cache, x], dim=2)