code: def load_cached_state_dict(model_folder_path):
      model_folder_path = download_if_needed(model_folder_path)
      # Take the first model matching the pattern *model.bin.
      model_path_list = glob.glob(
          os.path.join(model_folder_path, "*model.bin")
      )
      if not model_path_list:
          raise FileNotFoundError(
              f"model.bin not found in model folder {model_folder_path}."
          )
      model_path = model_path_list[0]
      state_dict = torch.load(model_path, map_location=device)
      return state_dict
  
imports: import json
  import os
  import pkgutil
  import importlib
  import tarfile
  from tempfile import NamedTemporaryFile
  import time
  import pandas
  import torch
  import glob
  from .None import device
  from .install import download_if_needed
label_desc: Use image node_id 5 for calling a global function with example usage: load_cached_state_dict(model_folder_path) and returns: state_dict