auto frontend

This commit is contained in:
游雁 2024-06-04 11:20:29 +08:00
parent 1fcb757216
commit ddd4ad419b

View File

@ -87,8 +87,16 @@ class AutoFrontend:
speech_lengths.sum().item() * self.frontend.frame_shift * self.frontend.lfr_n / 1000
)
speech.to(device=device), speech_lengths.to(device=device)
batch = {"input": speech, "input_len": speech_lengths, "key": key_batch}
if kwargs.get("return_pt", True):
speech, speech_lengths = speech.to(device=device), speech_lengths.to(device=device)
else:
speech, speech_lengths = speech.numpy(), speech_lengths.numpy()
batch = {
"input": speech,
"input_len": speech_lengths,
"key": key_batch,
data_type: "fbank",
}
result_list.append(batch)
pbar.update(1)