code: def main(args):
      path = args.checkpoint_path
      trainable_params = args.trainable_params.split(",")
  
      weights_all = torch.load(os.path.join(path, "pytorch_model.bin"))
  
      weights_trainable = {}
      weights_lora = {}
      for k in weights_all:
          if "lora" in k:
              k_new = (
                  k.replace("default.", "") if "default." in k else k
              )
              weights_lora[k_new] = weights_all[k]
          else:
              if any([n in k for n in trainable_params]):
                  weights_trainable[k[17:]] = weights_all[k]
  
      adapter_model = os.path.join(path, "adapter_model.bin")
      trainable_params = os.path.join(path, "trainable_params.bin")
      if not os.path.isfile(adapter_model):
          torch.save(weights_lora, adapter_model)
      torch.save(weights_trainable, trainable_params)
  
imports: import os
  import torch
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: main(args) without return types