code: def run_eval_streaming(args):
      dataset = _CONFIGS[args.model_type].dataset(args.dataset_path)
      bundle = _CONFIGS[args.model_type].bundle
      decoder = bundle.get_decoder()
      token_processor = bundle.get_token_processor()
      feature_extractor = bundle.get_feature_extractor()
      streaming_feature_extractor = (
          bundle.get_streaming_feature_extractor()
      )
      hop_length = bundle.hop_length
      num_samples_segment = bundle.segment_length * hop_length
      num_samples_segment_right_context = (
          num_samples_segment + bundle.right_context_length * hop_length
      )
  
      for idx in range(10):
          sample = dataset[idx]
          waveform = sample[0].squeeze()
          # Streaming decode.
          state, hypothesis = None, None
          for idx in range(0, len(waveform), num_samples_segment):
              segment = waveform[
                  idx : idx + num_samples_segment_right_context
              ]
              segment = torch.nn.functional.pad(
                  segment,
                  (0, num_samples_segment_right_context - len(segment)),
              )
              with torch.no_grad():
                  features, length = streaming_feature_extractor(
                      segment
                  )
                  hypos, state = decoder.infer(
                      features,
                      length,
                      10,
                      state=state,
                      hypothesis=hypothesis,
                  )
              hypothesis = hypos
              transcript = token_processor(hypos[0][0], lstrip=True)
              print(transcript, end="\r", flush=True)
          print()
  
          # Non-streaming decode.
          with torch.no_grad():
              features, length = feature_extractor(waveform)
              hypos = decoder(features, length, 10)
          print(token_processor(hypos[0][0]))
          print()
  
file_path: audio/examples/asr/emformer_rnnt/pipeline_demo.py
imports: import logging
  import pathlib
  from argparse import ArgumentParser, RawTextHelpFormatter
  from dataclasses import dataclass
  from functools import partial
  from typing import Callable
  import torch
  import torchaudio
  from common import MODEL_TYPE_LIBRISPEECH, MODEL_TYPE_MUSTC, MODEL_TYPE_TEDLIUM3
  from mustc.dataset import MUSTC
  from torchaudio.pipelines import EMFORMER_RNNT_BASE_LIBRISPEECH, RNNTBundle
  from torchaudio.prototype.pipelines import EMFORMER_RNNT_BASE_MUSTC, EMFORMER_RNNT_BASE_TEDLIUM3
label_desc: Use image node_id 1 for calling a global function with example usage: run_eval_streaming(args) without return types