code: def load_model(path: Path, verbose: int = 0) -> Dict[str, Any]:
      """Helper function to load Onnx model.
  
      Args:
          path: Path to the saved .onnx model.
  
          verbose: Print model details if verbose.
  
      Returns:
          Dict containing Onnx model session, input and output.
      """
      # specialize path
      mpath = str(path.with_suffix(".onnx"))
      if verbose:
          print(f"|-model path: {mpath}")
  
      sess = InferenceSession(mpath, providers=_providers)
  
      # getting input/output info dynamically
      model_dict = {
          "sess": sess,
          "input_name": sess.get_inputs()[0].name,
          "input_shape": sess.get_inputs()[0].shape,
          "input_type": sess.get_inputs()[0].type,
          "output_name": sess.get_outputs()[0].name,
          "output_shape": sess.get_outputs()[0].shape,
          "output_type": sess.get_outputs()[0].type,
      }
  
      if verbose:
          print(
              f'|-input: {model_dict["input_shape"]}, {model_dict["input_type"]}'
          )
          print(
              f'|-output: {model_dict["output_shape"]}, {model_dict["output_type"]}'
          )
  
      return model_dict
  
file_path: unisim/unisim/backend/onnx.py
imports: from pathlib import Path
  from typing import Any, Dict, Sequence, Union
  import numpy
  from onnxruntime import InferenceSession
  from ..types import BatchEmbeddings
label_desc: Use image node_id 2 for calling a global function with example usage: load_model(path, verbose) and returns: model_dict