mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
resume from step
This commit is contained in:
parent
1cdb3cc28d
commit
ab6391da4f
@ -159,7 +159,7 @@ class SenseVoiceDataset(torch.utils.data.Dataset):
|
||||
|
||||
def _filter_badcase(self, outputs, i=0):
|
||||
b, t, _ = outputs["speech"].shape
|
||||
|
||||
|
||||
if b * t > self.batch_size * 1.25:
|
||||
beg = torch.randint(0, 2, ()).item()
|
||||
if b < 2:
|
||||
@ -170,7 +170,6 @@ class SenseVoiceDataset(torch.utils.data.Dataset):
|
||||
for key, data_list in outputs.items():
|
||||
outputs[key] = outputs[key][beg : beg + b : 2]
|
||||
|
||||
|
||||
speech_lengths_max = outputs["speech_lengths"].max().item()
|
||||
outputs["speech"] = outputs["speech"][:, :speech_lengths_max, :]
|
||||
text_lengths_max = outputs["text_lengths"].max().item()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user