Skip to content

Commit

Permalink
fix length
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct committed Aug 14, 2024
1 parent 5288f24 commit af287ae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wenet/ssl/init_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def __iter__(self):
self.buf = []
self.length = 0
self.buf.append(elem)
self.length += current_length
self.length += elem_length
if len(self.buf) > 0:
yield self.merge_fn(self.buf)
del self.buf
Expand All @@ -53,7 +53,7 @@ def __iter__(self):
def cat_speech(buffer: List):
assert len(buffer) > 0
waves = [sample['wav'] for sample in buffer]
sample_rate = waves[0]['sample_rate']
sample_rate = buffer[0]['sample_rate']
wav = torch.cat(waves, dim=1)
return {"wav": wav, "sample_rate": sample_rate}

Expand Down

0 comments on commit af287ae

Please sign in to comment.