code: def transcribe_partial_audio(
      asr_model,
      path2manifest: str = None,
      batch_size: int = 4,
      logprobs: bool = False,
      return_hypotheses: bool = False,
      num_workers: int = 0,
      channel_selector: Optional[int] = None,
      augmentor: DictConfig = None,
      decoder_type: Optional[str] = None,
  ) -> List[str]:
      """
      See description of this function in trancribe() in nemo/collections/asr/models/ctc_models.py and nemo/collections/asr/models/rnnt_models.py
      """
  
      if return_hypotheses and logprobs:
          raise ValueError(
              "Either `return_hypotheses` or `logprobs` can be True at any given time."
              "Returned hypotheses will contain the logprobs."
          )
      if num_workers is None:
          num_workers = min(batch_size, os.cpu_count() - 1)
  
      # We will store transcriptions here
      hypotheses = []
      # Model's mode and device
      mode = asr_model.training
      device = next(asr_model.parameters()).device
      dither_value = asr_model.preprocessor.featurizer.dither
      pad_to_value = asr_model.preprocessor.featurizer.pad_to
  
      if decoder_type is not None:  # Hybrid model
          decode_function = (
              asr_model.decoding.rnnt_decoder_predictions_tensor
              if decoder_type == "rnnt"
              else asr_model.ctc_decoding.ctc_decoder_predictions_tensor
          )
      elif hasattr(asr_model, "joint"):  # RNNT model
          decode_function = (
              asr_model.decoding.rnnt_decoder_predictions_tensor
          )
      else:  # CTC model
          decode_function = (
              asr_model.decoding.ctc_decoder_predictions_tensor
          )
  
      try:
          asr_model.preprocessor.featurizer.dither = 0.0
          asr_model.preprocessor.featurizer.pad_to = 0
          # Switch model to evaluation mode
          asr_model.eval()
          # Freeze the encoder and decoder modules
          asr_model.encoder.freeze()
          asr_model.decoder.freeze()
          logging_level = logging.get_verbosity()
          logging.set_verbosity(logging.WARNING)
  
          config = {
              "manifest_filepath": path2manifest,
              "batch_size": batch_size,
              "num_workers": num_workers,
              "channel_selector": channel_selector,
          }
          if augmentor:
              config["augmentor"] = augmentor
  
          temporary_datalayer = asr_model._setup_transcribe_dataloader(
              config
          )
          for test_batch in tqdm(
              temporary_datalayer, desc="Transcribing"
          ):
              outputs = asr_model.forward(
                  input_signal=test_batch[0].to(device),
                  input_signal_length=test_batch[1].to(device),
              )
              logits, logits_len = outputs[0], outputs[1]
  
              if (
                  isinstance(asr_model, EncDecHybridRNNTCTCModel)
                  and decoder_type == "ctc"
              ):
                  logits = asr_model.ctc_decoder(encoder_output=logits)
  
              logits = logits.cpu()
  
              if logprobs:
                  logits = logits.numpy()
                  # dump log probs per file
                  for idx in range(logits.shape[0]):
                      lg = logits[idx][: logits_len[idx]]
                      hypotheses.append(lg)
              else:
                  current_hypotheses, _ = decode_function(
                      logits,
                      logits_len,
                      return_hypotheses=return_hypotheses,
                  )
  
                  if return_hypotheses:
                      # dump log probs per file
                      for idx in range(logits.shape[0]):
                          current_hypotheses[idx].y_sequence = logits[
                              idx
                          ][: logits_len[idx]]
                          if current_hypotheses[idx].alignments is None:
                              current_hypotheses[
                                  idx
                              ].alignments = current_hypotheses[
                                  idx
                              ].y_sequence
  
                  hypotheses += current_hypotheses
  
              del logits
              del test_batch
  
      finally:
          # set mode back to its original value
          asr_model.train(mode=mode)
          asr_model.preprocessor.featurizer.dither = dither_value
          asr_model.preprocessor.featurizer.pad_to = pad_to_value
          if mode is True:
              asr_model.encoder.unfreeze()
              asr_model.decoder.unfreeze()
          logging.set_verbosity(logging_level)
      return hypotheses
  
imports: import glob
  import json
  import os
  import re
  from dataclasses import dataclass
  from typing import List, Optional, Tuple, Union
  import torch
  from omegaconf import DictConfig
  from tqdm.auto import tqdm
  import nemo.collections.asr
  from nemo.collections.asr.metrics.wer import word_error_rate
  from nemo.collections.asr.models import ASRModel, EncDecHybridRNNTCTCModel
  from nemo.collections.asr.parts.utils import rnnt_utils
  from nemo.collections.asr.parts.utils.streaming_utils import FrameBatchASR
  from nemo.collections.common.metrics.punct_er import OccurancePunctuationErrorRate
  from nemo.collections.common.parts.preprocessing.manifest import get_full_path
  from nemo.utils import logging, model_utils
label_desc: Use image node_id 9 for calling a global function with example usage: transcribe_partial_audio(asr_model, path2manifest, batch_size, logprobs, return_hypotheses, num_workers, channel_selector, augmentor, decoder_type) and returns: hypotheses