code: def extract_local_archive_file(
      pretrained_model_name_or_path, subfolder, variant=None
  ):
      pretrained_model_name_or_path = str(pretrained_model_name_or_path)
      if os.path.isfile(
          os.path.join(
              pretrained_model_name_or_path,
              subfolder,
              _add_variant(WEIGHTS_NAME, variant),
          )
      ):
          # Load from a PyTorch checkpoint
          archive_file = os.path.join(
              pretrained_model_name_or_path,
              subfolder,
              _add_variant(WEIGHTS_NAME, variant),
          )
          return archive_file, False
      elif os.path.isfile(
          os.path.join(
              pretrained_model_name_or_path,
              subfolder,
              _add_variant(WEIGHTS_INDEX_NAME, variant),
          )
      ):
          # Load from a sharded PyTorch checkpoint
          archive_file = os.path.join(
              pretrained_model_name_or_path,
              subfolder,
              _add_variant(WEIGHTS_INDEX_NAME, variant),
          )
          is_sharded = True
          return archive_file, is_sharded
      else:
          invalidInputError(
              False,
              f"Error no file named {_add_variant(WEIGHTS_NAME, variant)}"
              " found in directory"
              f" {pretrained_model_name_or_path}.",
          )
  
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 1 for calling a global function with example usage: extract_local_archive_file(pretrained_model_name_or_path, subfolder, variant) and returns: archive_file,  False, archive_file,  is_sharded