code: def load_quant(
      model: nn.Module, checkpoint: str, wbits: int, groupsize: int
  ):
      model = model.eval()
      layers = find_layers(model)
  
      # ignore lm head
      layers = find_layers(model)
      for name in ["lm_head"]:
          if name in layers:
              del layers[name]
  
      make_quant(model, layers, wbits, groupsize)
  
      if checkpoint.endswith(".safetensors"):
          from safetensors.torch import load_file as safe_load
  
          model.load_state_dict(safe_load(checkpoint))
      else:
          model.load_state_dict(torch.load(checkpoint))
  
      return model
  
imports: import torch
  import torch.nn
  from .model_utils import find_layers
  from .quant import make_quant
label_desc: Use image node_id 1 for calling a global function with example usage: load_quant(model, checkpoint, wbits, groupsize) and returns: model