code: def load_state_dict(checkpoint_file: Union[str, os.PathLike]):
      try:
          return torch.load(checkpoint_file, map_location="cpu")
      except Exception as e:
          invalidInputError(
              False,
              f"Unable to load weights"
              "from pytorch checkpoint file for '{checkpoint_file}' "
              f"at '{checkpoint_file}'. ",
          )
  
file_path: BigDL/python/llm/src/bigdl/llm/transformers/utils.py
imports: import os
  from transformers.modeling_utils import _add_variant
  from ..utils.common import invalidInputError
  from typing import Union
  import torch
  from torch import nn
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: load_state_dict(checkpoint_file) and returns: torch