dslee2601 commited on
Commit
1629823
·
1 Parent(s): 10401b1
Files changed (1) hide show
  1. model.py +4 -1
model.py CHANGED
@@ -193,7 +193,10 @@ class DAC(PreTrainedModel):
193
  rest_of_new_x = waveform[:,:,overlap_size_in_data_space:]
194
  overlap_x_from_prev_x = waveform_concat[:,:,-overlap_size_in_data_space:] # (b, 1, overlap_size_in_data_space)
195
  overlap_x_from_new_x = waveform[:,:,:overlap_size_in_data_space] # (b, 1, overlap_size_in_data_space)
196
- overlap = (overlap_x_from_prev_x + overlap_x_from_new_x) / 2 # take mean; maybe there's a better strategy but it seems to work fine.
 
 
 
197
  waveform_concat = torch.cat((prev_x, overlap, rest_of_new_x), dim=-1) # (b, 1, ..)
198
  else:
199
  prev_x = waveform_concat
 
193
  rest_of_new_x = waveform[:,:,overlap_size_in_data_space:]
194
  overlap_x_from_prev_x = waveform_concat[:,:,-overlap_size_in_data_space:] # (b, 1, overlap_size_in_data_space)
195
  overlap_x_from_new_x = waveform[:,:,:overlap_size_in_data_space] # (b, 1, overlap_size_in_data_space)
196
+ if not overlap_x_from_new_x.shape[-1] == 0:
197
+ overlap = (overlap_x_from_prev_x + overlap_x_from_new_x) / 2 # take mean; maybe there's a better strategy but it seems to work fine.
198
+ else:
199
+ overlap = overlap_x_from_prev_x
200
  waveform_concat = torch.cat((prev_x, overlap, rest_of_new_x), dim=-1) # (b, 1, ..)
201
  else:
202
  prev_x = waveform_concat