code: def has_4bit_bnb_layers(model):
      """Check if we have `bnb.nn.Linear4bit` or `bnb.nn.Linear8bitLt` layers inside our model"""
      # bitsandbytes will initialize CUDA on import, so it needs to be imported lazily
      import bitsandbytes as bnb
  
      for m in model.modules():
          if isinstance(m, bnb.nn.Linear4bit):
              return True
      return False
  
file_path: accelerate/src/accelerate/utils/bnb.py
imports: import logging
  import os
  from copy import deepcopy
  from typing import Dict, List, Optional, Union
  import torch
  import torch.nn
  from accelerate.utils.imports import is_4bit_bnb_available, is_8bit_bnb_available
  from ..big_modeling import dispatch_model, init_empty_weights
  from .dataclasses import BnbQuantizationConfig
  from .modeling import find_tied_parameters, get_balanced_memory, infer_auto_device_map, load_checkpoint_in_model, offload_weight, set_module_tensor_to_device
label_desc: Use image node_id 6 for calling a global function with example usage: has_4bit_bnb_layers(model) and returns: False, True