code: def try_load_existing_model(
      attributes,
      cache_dir,
      accelerator,
      ipex,
      precision,
      low_memory,
      device,
      additional_suffix=None,
      lora_name=None,
      return_model=True,
  ):
      cache_path = _get_cache_path(
          cache_dir,
          accelerator=accelerator,
          ipex=ipex,
          precision=precision,
          low_memory=low_memory,
          additional_suffix=additional_suffix,
          lora_name=lora_name,
      )
      if os.path.exists(cache_path):
          try:
              if return_model:
                  print(
                      f"Loading the existing cache from {cache_path} to {device}"
                  )
                  nano_model = InferenceOptimizer.load(
                      cache_path, device=device
                  )
                  for k, v in attributes.items():
                      if k not in dir(nano_model):
                          setattr(nano_model, k, v)
                  return (nano_model, cache_path)
              else:
                  print(
                      f"The existing cache {cache_path} exists, don't load it"
                  )
                  return ("exists", cache_path)  # placeholder
          except Exception as e:
              print(
                  f"The cache path {cache_path} exists, \
                    but failed to load. Error message: {str(e)}"
              )
      return (None, cache_path)
  
file_path: BigDL/python/nano/src/bigdl/nano/diffusion/common/load.py
imports: import os
  import time
  from collections import OrderedDict
  from huggingface_hub import snapshot_download
  from bigdl.nano.pytorch import InferenceOptimizer
label_desc: Use image node_id 2 for calling a global function with example usage: try_load_existing_model(attributes, cache_dir, accelerator, ipex, precision, low_memory, device, additional_suffix, lora_name, return_model) and returns: None,  cache_path, nano_model,  cache_path, str,  cache_path