| | |
| | | def _forward(data_path_and_name_and_type, |
| | | raw_inputs: Union[np.ndarray, torch.Tensor] = None, |
| | | output_dir_v2: Optional[str] = None, |
| | | fs: dict = None, |
| | | param_dict: dict = None, |
| | | ): |
| | | # 3. Build data-iterator |
| | |
| | | loader = ASRTask.build_streaming_iterator( |
| | | data_path_and_name_and_type, |
| | | dtype=dtype, |
| | | fs=fs, |
| | | batch_size=1, |
| | | key_file=key_file, |
| | | num_workers=num_workers, |
| | |
| | | punc_id_list = "" |
| | | text_postprocessed_punc = "" |
| | | |
| | | item = {'key': key, 'value': text_postprocessed_punc_time_stamp, 'text': text_postprocessed, |
| | | 'time_stamp': time_stamp_postprocessed, 'punc': punc_id_list, 'token': token} |
| | | if outputs_dict: |
| | | item = {'text_punc': text_postprocessed_punc, 'text': text_postprocessed, |
| | | 'punc_id': punc_id_list, 'token': token, 'time_stamp': time_stamp_postprocessed} |
| | | item = {'key': key, 'value': item} |
| | | item = {'key': key, 'value': text_postprocessed_punc, 'text_postprocessed': text_postprocessed, |
| | | 'time_stamp': time_stamp_postprocessed, 'token': token} |
| | | asr_result_list.append(item) |
| | | finish_count += 1 |
| | | # asr_utils.print_progress(finish_count / file_count) |