code: def load(name_or_dir: Union[str, Path]) -> ModelWrapper:
      """
      Load a model that was trained previously.
  
      Args:
          name_or_dir (Union[str, Path]): The name of the experiment (will search for
              model files in ./{name} and ./traintool-experiments/{name}) or the complete
              path to the output directory.
  
      Returns:
          ModelWrapper: The loaded model
      """
  
      # Find output dir, checking that it exists
      if Path(name_or_dir).is_dir():  # path = name_or_dir
          out_dir = Path(name_or_dir)
      elif (Path.cwd() / name_or_dir).is_dir():  # path = ./name_or_dir
          out_dir = Path.cwd() / name_or_dir
      elif (
          Path.cwd() / "traintool-experiments" / name_or_dir
      ).is_dir():  # path = ./traintool-experiments/name_or_dir
          out_dir = Path.cwd() / "traintool-experiments" / name_or_dir
      else:
          raise FileNotFoundError(
              f"Could not find experiment or path: {name_or_dir}"
          )
  
      # Read model_name from out_dir / info.yml
      info = _read_info_file(out_dir)
      model_name = info["model_name"]
  
      # Resolve model wrapper class and call load method
      model_wrapper_class = _resolve_model(model_name)
      model_wrapper = model_wrapper_class(
          model_name, info["config"], out_dir
      )
      model_wrapper._load()
      return model_wrapper
  
imports: from comet_ml import Experiment
  from typing import Union, Type
  from pathlib import Path
  import yaml
  from tensorboardX import SummaryWriter
  import tempfile
  import editdistance
  import numpy
  from datetime import datetime
  from loguru import logger
  import sys
  from .None import utils
  from .None import image_classification
  from .model_wrapper import ModelWrapper
label_desc: Use image node_id 8 for calling a global function with example usage: load(name_or_dir) and returns: model_wrapper