code: def get_keys_to_not_convert(model):
      r"""
      An utility function to get the key of the module to keep in full precision if any For example for CausalLM modules
      we may want to keep the lm_head in full precision for numerical stability reasons. For other architectures, we want
      to keep the tied weights of the model. The function will return a list of the keys of the modules to not convert in
      int8.
  
      Parameters:
      model (`torch.nn.Module`):
          Input model
      """
      # Create a copy of the model and tie the weights, then
      # check if it contains tied weights
      tied_model = deepcopy(
          model
      )  # this has 0 cost since it is done inside `init_empty_weights` context manager`
      tied_model.tie_weights()
  
      tied_keys = list(find_tied_parameters(tied_model).values())
      has_tied_params = len(tied_keys) > 0
  
      # Check if it is a base model
      is_base_model = not hasattr(model, model.base_model_prefix)
  
      # Ignore this for base models (BertModel, GPT2Model, etc.)
      if (not has_tied_params) and is_base_model:
          return ""
  
      # otherwise they have an attached head
      list_modules = list(model.named_parameters())
      list_last_module = [list_modules[-1][0]]
  
      # add last module together with tied weights
      intersection = set(list_last_module) - set(tied_keys)
      list_untouched = tied_keys + list(intersection)
  
      return [
          module_name.split(".")[0] for module_name in list_untouched
      ]
  
imports: from copy import deepcopy
  from transformers.utils import is_accelerate_available, is_bitsandbytes_available
label_desc: Use image node_id 3 for calling a global function with example usage: get_keys_to_not_convert(model) and returns: unknown, str