code: def save_hf_format(model, tokenizer, args, sub_folder=""):
      # used to save huggingface format, so we can use it for hf.from_pretrained
      model_to_save = (
          model.module if hasattr(model, "module") else model
      )
      CONFIG_NAME = "config.json"
      WEIGHTS_NAME = "pytorch_model.bin"
      output_dir = os.path.join(args.output_dir, sub_folder)
      os.makedirs(output_dir, exist_ok=True)
      output_model_file = os.path.join(output_dir, WEIGHTS_NAME)
      output_config_file = os.path.join(output_dir, CONFIG_NAME)
      save_dict = model_to_save.state_dict()
      for key in list(save_dict.keys()):
          if "lora" in key:
              del save_dict[key]
      torch.save(save_dict, output_model_file)
      model_to_save.config.to_json_file(output_config_file)
      tokenizer.save_vocabulary(output_dir)
  
imports: import os
  import torch
  import random
  import numpy
  from transformers import set_seed, AutoTokenizer
  import json
  import deepspeed
  from deepspeed.runtime.zero.partition_parameters import ZeroParamStatus
  from deepspeed.accelerator import get_accelerator
  import torch.nn
label_desc: Use image node_id 6 for calling a global function with example usage: save_hf_format(model, tokenizer, args, sub_folder) without return types