code: def load_model(
      bento_model: str | Tag | bentoml.Model,
      *,
      providers: ProvidersType | None = None,
      session_options: ort.SessionOptions | None = None,
  ) -> ort.InferenceSession:
      """
      Load the onnx model with the given tag from the local BentoML model store.
  
      Args:
          bento_model (``str`` ``|`` :obj:`~bentoml.Tag` ``|`` :obj:`~bentoml.Model`):
              Either the tag of the model to get from the store, or a BentoML `~bentoml.Model`
              instance to load the model from.
          providers (`List[Union[str, Tuple[str, Dict[str, Any]]`, `optional`, default to :code:`None`):
              Different providers provided by users. By default BentoML will use ``["CPUExecutionProvider"]``
              when loading a model.
          session_options (`onnxruntime.SessionOptions`, `optional`, default to :code:`None`):
              SessionOptions per use case. If not specified, then default to :code:`None`.
  
      Returns:
          :obj:`onnxruntime.InferenceSession`:
              An instance of ONNX Runtime inference session created using ONNX model loaded from the model store.
  
      Example:
  
      .. code-block:: python
  
          import bentoml
          sess = bentoml.onnx.load_model("my_onnx_model")
      """  # noqa
  
      if not isinstance(bento_model, bentoml.Model):
          bento_model = get(bento_model)
  
      if bento_model.info.module not in (MODULE_NAME, __name__):
          raise NotFound(
              f"Model {bento_model.tag} was saved with module {bento_model.info.module}, not loading with {MODULE_NAME}."
          )
  
      if providers:
          if not all(
              i in ort.get_all_providers()
              for i in flatten_providers_list(providers)
          ):
              raise BentoMLException(
                  f"'{providers}' cannot be parsed by `onnxruntime`"
              )
      else:
          providers = ["CPUExecutionProvider"]
  
      return ort.InferenceSession(
          bento_model.path_of(MODEL_FILENAME),
          sess_options=session_options,
          providers=providers,
      )
  
imports: from __future__ import annotations
  import logging
  import os
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import attr
  import bentoml
  from bentoml import Tag
  from bentoml.exceptions import BentoMLException
  from bentoml.exceptions import MissingDependencyException
  from bentoml.exceptions import NotFound
  from bentoml.models import ModelContext
  from bentoml.models import ModelOptions
  from ..utils.pkg import PackageNotFoundError
  from ..utils.pkg import get_pkg_version
label_desc: Use image node_id 4 for calling a global function with example usage: load_model(bento_model) and returns: ort