code: def export_ls_config(
      file,
      head_num,
      src_padding_id,
      trg_start_id,
      trg_end_id,
      n_encoder_stack,
      n_decoder_stack,
      is_post_ln=False,
      no_scale_embedding=False,
      use_gelu=False,
      beam_size=4,
      length_penalty=0.6,
      extra_decode_length=50,
      sampling_method="beam_search",
      topk=1,
      topp=0.75,
      diverse_lambda=0,
      save_pb=True,
  ):
      args = locals()
      args.pop("file")
      args.pop("save_pb")
      if save_pb:
          args.pop("n_encoder_stack")
          args.pop("n_decoder_stack")
          for v in list(args.keys()):
              exec("file.model_conf.{0} = {0}".format(v))
      else:
          sampling_method = np.array(
              [ord(c) for c in sampling_method]
          ).astype(np.int8)
          for v in list(args.keys()):
              exec(
                  "file.create_dataset('model_conf/{0}', data={0})".format(
                      v
                  )
              )
  
file_path: lightseq/lightseq/training/ops/pytorch/export.py
imports: from collections import OrderedDict
  import numpy
  from lightseq.training.ops.pytorch.util import get_pos_embedding
  from lightseq.training import LSTransformerEncoderLayer, LSTransformerDecoderLayer
label_desc: Use image node_id 9 for calling a global function with example usage: export_ls_config(file, head_num, src_padding_id, trg_start_id, trg_end_id, n_encoder_stack, n_decoder_stack, is_post_ln, no_scale_embedding, use_gelu, beam_size, length_penalty, extra_decode_length, sampling_method, topk, topp, diverse_lambda, save_pb) without return types