| | |
| | | |
| | | # data: (Nsamples,) -> (1, Nsamples) |
| | | # lengths: (1,) |
| | | if len(speech.size()) < 3: |
| | | speech = speech.unsqueeze(0).to(getattr(torch, self.dtype)) |
| | | speech_lengths = speech.new_full([1], dtype=torch.long, fill_value=speech.size(1)) |
| | | # if len(speech.size()) < 3: |
| | | # speech = speech.unsqueeze(0).to(getattr(torch, self.dtype)) |
| | | # speech_lengths = speech.new_full([1], dtype=torch.long, fill_value=speech.size(1)) |
| | | lfr_factor = max(1, (speech.size()[-1]//80)-1) |
| | | |
| | | batch = {"speech": speech, "speech_lengths": speech_lengths} |
| | |
| | | "decoding, feature length: {}, forward_time: {:.4f}, rtf: {:.4f}". |
| | | format(length, forward_time, 100 * forward_time / (length*lfr_factor))) |
| | | |
| | | for batch_id in range(len(results)): |
| | | for batch_id in range(_bs): |
| | | result = [results[batch_id][:-2]] |
| | | |
| | | key = keys[batch_id] |