code: def run_bench(model_path, args):
      bin_dir = os.path.realpath("../../../build/")
      print(bin_dir)
      bin_path = "examples/inference/cpp/transformer_example"
      full_bin_path = os.path.join(bin_dir, bin_path)
      if not os.path.exists(full_bin_path):
          raise RuntimeError(
              "can't find {}, please check if you build inference cpp example successfully".format(
                  full_bin_path
              )
          )
      res = subprocess.check_output(
          " ".join(
              [
                  full_bin_path,
                  model_path,
                  str(args.batch_size),
                  str(args.input_seq_len),
              ]
          ),
          # check=True,
          # capture_output=True,
          shell=True,
          # text=True,
      )
      latency = 0
      print(res)
      for line in res.stdout.splitlines():
          if "latency" in line:
              latency = re.findall(r"\d+\.\d+ms", line)[0]
      return latency
  
file_path: lightseq/examples/inference/python/generate_model.py
imports: import argparse
  import subprocess
  import os
  import re
  import h5py
  import numpy
  from export.huggingface.hf_bart_export import extract_transformer_weights
  from export.huggingface.hf_gpt2_export import extract_gpt_weights
  from export.huggingface.ls_hf_quant_gpt2_export import extract_gpt_weights
label_desc: Use image node_id 3 for calling a global function with example usage: run_bench(model_path, args) and returns: latency