code: def main(device, src, option=None):
      print("Building pipeline...")
      model_path = download_asset(
          "tutorial-assets/device_avsr_model.pt"
      )
      spm_model_path = download_asset(
          "tutorial-assets/spm_unigram_1023.model"
      )
  
      pipeline = _get_inference_pipeline(model_path, spm_model_path)
  
      BUFFER_SIZE = 32
      segment_length = 8
      context_length = 4
      sample_rate = 19200
      frame_rate = 30
      rate_ratio = sample_rate // frame_rate
      cacher = ContextCacher(BUFFER_SIZE, context_length, rate_ratio)
  
      import torch.multiprocessing as mp
  
      ctx = mp.get_context("spawn")
  
      @torch.inference_mode()
      def infer():
          num_video_frames = 0
          video_chunks = []
          audio_chunks = []
          while True:
              chunk_v, chunk_a = q.get()
              num_video_frames += chunk_a.size(0) // 640
              video_chunks.append(chunk_v)
              audio_chunks.append(chunk_a)
              if num_video_frames < BUFFER_SIZE:
                  continue
              video = torch.cat(video_chunks)
              audio = torch.cat(audio_chunks)
              video, audio = cacher(video, audio)
              pipeline.state, pipeline.hypotheses = None, None
              transcript = pipeline(audio, video.float())
              print(transcript, end="", flush=True)
              num_video_frames = 0
              video_chunks = []
              audio_chunks = []
  
      q = ctx.Queue()
      p = ctx.Process(
          target=stream,
          args=(q, device, option, src, segment_length, sample_rate),
      )
      p.start()
      infer()
      p.join()
  
imports: import numpy
  import sentencepiece
  import torch
  import torchaudio
  import torchvision
  import sys
  from avsr.data_prep.detectors.mediapipe.detector import LandmarksDetector
  from avsr.data_prep.detectors.mediapipe.video_process import VideoProcess
  from torchaudio.utils import download_asset
label_desc: Use image node_id 3 for calling a global function with example usage: main(device, src, option) without return types