code: def eval_test_batch_from_scratch(
      encoder_decoder_asr,
      test_set,
      test_kwargs,
      reporter,
      pretrainer_load_audio=False,
  ):
      """Relies only on batched audio paths to create batches using the pretrained interface only.
  
      Parameters
      ----------
      encoder_decoder_asr: speechbrain.inference.ASR.EncoderDecoderASR
          Pretrained interface (other interfaces will require other functions to be called; this is an example).
      test_set: Dataset, DataLoader
          If a DataLoader is given, it is iterated directly. Otherwise passed to `sb.dataio.dataloader.make_dataloader()`.
      test_kwargs: dict
          Data loader options for testing.
      reporter: dict
          Maps metric labels to performance trackers (instances) which need summarise certain fields for final reporting.
      pretrainer_load_audio: bool (Default: False)
          Whether to use Pretrainer.load_audio (True) or dataio.read_audio (False).
      """
      if "ckpt_prefix" in test_kwargs:
          del test_kwargs["ckpt_prefix"]
      if not (
          isinstance(test_set, DataLoader)
          or isinstance(test_set, LoopedLoader)
      ):
          test_set = make_dataloader(test_set, **test_kwargs)
  
      with torch.no_grad():
          for batch in tqdm(
              test_set, dynamic_ncols=True, disable=False
          ):
              # instead of using batch.sig, we desire to see pretrained_hf_asr.load_audio in action
              wavs = []
              for audio_path in batch.wav:  # get the paths only
                  if pretrainer_load_audio:
                      wavs.append(
                          encoder_decoder_asr.load_audio(
                              path=audio_path, silent_local_fetch=True
                          )
                      )
                  else:
                      wavs.append(
                          read_audio(audio_path).to(
                              encoder_decoder_asr.device
                          )
                      )
              wavs, wav_lens = batch_pad_right(wavs)
              predictions = encoder_decoder_asr(wavs, wav_lens)
  
              # prepare for metric reporting
              predicted = [wrd.split(" ") for wrd in predictions[0]]
              targeted = [wrd.split(" ") for wrd in batch.words]
              ids = batch.id
              for metric in reporter.keys():
                  reporter[metric]["tracker"].append(
                      ids=ids, predict=predicted, target=targeted
                  )
  
          # Report summary
          ddp_barrier()
          eval_reporting(reports=reporter)
  
imports: import os
  import sys
  import torch
  import logging
  import speechbrain
  from copy import deepcopy
  from tqdm.contrib import tqdm
  from torch.utils.data import DataLoader
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.inference.ASR import EncoderDecoderASR
  from speechbrain.utils.distributed import run_on_main, ddp_barrier
  from speechbrain.utils.data_utils import batch_pad_right
  from speechbrain.dataio.dataset import DynamicItemDataset
  from speechbrain.dataio.sampler import DynamicBatchSampler
  from speechbrain.dataio.dataloader import LoopedLoader, make_dataloader, distributed_loader_specifics
  from speechbrain.dataio.dataio import read_audio
  from ASR_template_train import ASR, dataio_prepare
label_desc: Use image node_id 3 for calling a global function with example usage: eval_test_batch_from_scratch(encoder_decoder_asr, test_set, test_kwargs, reporter, pretrainer_load_audio) without return types