code: def get_local_shard_files(
      pretrained_model_name_or_path, index_filename, subfolder=""
  ):
      import json
  
      invalidInputError(
          os.path.isfile(index_filename),
          "Can't find a checkpoint index"
          f" ({index_filename}) in {pretrained_model_name_or_path}.",
      )
  
      with open(index_filename, "r") as f:
          index = json.loads(f.read())
  
      shard_filenames = sorted(set(index["weight_map"].values()))
      sharded_metadata = index["metadata"]
      sharded_metadata["all_checkpoint_keys"] = list(
          index["weight_map"].keys()
      )
      sharded_metadata["weight_map"] = index["weight_map"].copy()
  
      shard_filenames = [
          os.path.join(pretrained_model_name_or_path, subfolder, f)
          for f in shard_filenames
      ]
      return shard_filenames, sharded_metadata
  
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 4 for calling a global function with example usage: get_local_shard_files(pretrained_model_name_or_path, index_filename, subfolder) and returns: shard_filenames,  sharded_metadata