code: def get_model(repo, values, updates_dir=None, run_opts=None):
      """Fetches a pretrained model with the option the re-specify its hyperparameters & interface.
  
      Parameters
      ----------
      repo: str
          Source of pretrained model (assuming its within the HF speechbrain collection).
      values: dict
          Interface specification.
          Example: speechbrain:hf-interface-testing/updates_pretrained_models/ssl-wav2vec2-base-librispeech/test.yaml
      updates_dir: str
          Local folder with yaml:interface updates; None (default) = take original yaml/interface specification.
      run_opts: dict
          Run options, such as device
  
      Returns
      -------
      A pretrained model with a speechbrain.inference.interface or a custom interface.
      """
      # get the pretrained class; model & predictions
      kwargs = {
          "source": f"speechbrain/{repo}",
          "savedir": f"pretrained_models/{repo}",
      }
  
      # adjust symlinks
      hparams = f"pretrained_models/{repo}/hyperparams.yaml"
      if (
          "foreign" in values.keys()
      ):  # it's a custom model which has its own Python filename
          custom = f'pretrained_models/{repo}/{values["foreign"]}'
      # prepare model loading: is it the old -or- the new yaml/interface?
      if updates_dir is not None:
          # testing the refactoring; assuming all model data has been loaded already
          kwargs["source"] = f"{updates_dir}/{repo}"
          os.unlink(hparams)
          os.symlink(f"{updates_dir}/{repo}/hyperparams.yaml", hparams)
          if "foreign" in values.keys():
              os.unlink(custom)
              os.symlink(
                  f'{updates_dir}/{repo}/{values["foreign"]}',
                  custom,
              )
      else:
          # re:testing on develop? => simply unlink anything before and re:link from cached HF hub
          if os.path.exists(hparams):
              os.unlink(hparams)
          if "foreign" in values.keys():
              if os.path.exists(custom):
                  os.unlink(custom)
  
      if run_opts is not None:
          kwargs["run_opts"] = run_opts
  
      print(f"\trepo: {repo}")
      # load pretrained model either via specified pretrained class or custom interface
      if "foreign" not in values.keys():
          print(f'\tspeechbrain.inference.{values["cls"]}')
          print(f"\tobj.from_hparams({kwargs})")
          obj = eval(f'speechbrain.inference.{values["cls"]}')
          model = obj.from_hparams(**kwargs)
      else:
          kwargs["pymodule_file"] = values["foreign"]
          kwargs["classname"] = values["cls"]
          model = foreign_class(**kwargs)
  
      return model
  
imports: import os
  import sys
  from tqdm import tqdm
  import yaml
  import torch
  import importlib
  import subprocess
  import speechbrain
  from glob import glob
  from copy import deepcopy
  from torch.utils.data import DataLoader
  from hyperpyyaml import load_hyperpyyaml
  from speechbrain.utils.distributed import run_on_main
  from speechbrain.utils.train_logger import FileTrainLogger
  from speechbrain.inference.interfaces import foreign_class
  from speechbrain.dataio.dataloader import LoopedLoader, make_dataloader
label_desc: Use image node_id 2 for calling a global function with example usage: get_model(repo, values, updates_dir, run_opts) and returns: model