code: def load_model(
      bentoml_model: str | Tag | Model,
      device_id: str | None = "cpu",
      *,
      _extra_files: dict[str, t.Any] | None = None,
  ) -> torch.ScriptModule | tuple[torch.ScriptModule, dict[str, t.Any]]:
      """
      Load a model from BentoML local modelstore with given name.
  
      Args:
          tag:
              Tag of a saved model in BentoML local modelstore.
          device_id:
              Optional devices to put the given model on. Refer to https://pytorch.org/docs/stable/tensor_attributes.html#torch.torch.device
          _extra_files:
              A dictionary of file names and a empty string. See https://pytorch.org/docs/stable/generated/torch.jit.load.html.
  
      Returns:
          :obj:`torch.ScriptModule`: an instance of :obj:`torch.ScriptModule` from BentoML modelstore.
  
      Examples:
  
      .. code-block:: python
  
          import bentoml
          lit = bentoml.torchscript.load_model('lit_classifier:latest', device_id="cuda:0")
      """
      if isinstance(bentoml_model, (str, Tag)):
          bentoml_model = get(bentoml_model)
  
      if bentoml_model.info.module not in (MODULE_NAME, __name__):
          raise NotFound(
              f"Model {bentoml_model.tag} was saved with module {bentoml_model.info.module}, not loading with {MODULE_NAME}."
          )
      weight_file = bentoml_model.path_of(MODEL_FILENAME)
  
      model: torch.ScriptModule = torch.jit.load(
          weight_file,
          map_location=device_id,
          _extra_files=_extra_files,
      )
      return model
  
file_path: BentoML/grpc-client/bentoml/_internal/frameworks/torchscript.py
imports: from __future__ import annotations
  import logging
  import typing
  from types import ModuleType
  from typing import TYPE_CHECKING
  import bentoml
  from bentoml import Tag
  from ...exceptions import NotFound
  from ..models.model import Model
  from ..models.model import ModelContext
  from ..models.model import PartialKwargsModelOptions
  from ..utils.pkg import get_pkg_version
  from .common.pytorch import torch
label_desc: Use image node_id 2 for calling a global function with example usage: load_model(bentoml_model, device_id) and returns: model