mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
auto frontend
This commit is contained in:
parent
1fcb757216
commit
ddd4ad419b
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user