code: def export_other_weights(ls_infer_model, state_dict, vocab_size):
      enc_norm_w = (
          state_dict["encoder.layer_norm.weight"].flatten().tolist()
      )
      enc_norm_b = (
          state_dict["encoder.layer_norm.bias"].flatten().tolist()
      )
      dec_norm_w = (
          state_dict["decoder.layer_norm.weight"].flatten().tolist()
      )
      dec_norm_b = (
          state_dict["decoder.layer_norm.bias"].flatten().tolist()
      )
      output_ln_clip_max = state_dict[
          "decoder.output_projection.input_quant.clip.clip_value_max"
      ]
      logits_clip_max = state_dict[
          "decoder.output_projection.output_quant._amax"
      ]
      dec_shared_b = torch.zeros(vocab_size).flatten().tolist()
  
      ls_infer_model.src_embedding.norm_scale[:] = enc_norm_w
      ls_infer_model.src_embedding.norm_bias[:] = enc_norm_b
      ls_infer_model.trg_embedding.norm_scale[:] = dec_norm_w
      ls_infer_model.trg_embedding.norm_bias[:] = dec_norm_b
      ls_infer_model.trg_embedding.shared_bias[:] = dec_shared_b
      ls_infer_model.trg_embedding.output_ln_clip_max = (
          output_ln_clip_max
      )
      ls_infer_model.trg_embedding.logits_clip_max = logits_clip_max
  
file_path: lightseq/examples/inference/python/export/ls_quant_transformer_export.py
imports: import argparse
  import time
  import numpy
  import torch
  from transformers import BertTokenizer
  from proto.quant_transformer_pb2 import QuantTransformer
  from lightseq.training import export_ls_config, export_ls_quant_embedding, export_ls_quant_encoder, export_ls_quant_decoder, LSTransformer
  import lightseq.inference
label_desc: Use image node_id 2 for calling a global function with example usage: export_other_weights(ls_infer_model, state_dict, vocab_size) without return types