code: def run_native_int4(
      repo_id, local_model_hub, in_out_pairs, warm_up, num_trials
  ):
      model_path = get_model_path(repo_id, local_model_hub)
      from bigdl.llm.transformers import BigdlNativeForCausalLM
      from bigdl.llm import llm_convert
  
      if "chatglm" in repo_id.lower():
          family = "chatglm"
      elif "llama" in repo_id.lower():
          family = "llama"
      else:
          invalidInputError(False, "Model family unknown: " + repo_id)
  
      bigdl_llm_path = llm_convert(
          model=model_path,
          outfile="./",
          outtype="int4",
          model_family=family,
      )
      for in_out in in_out_pairs:
          in_out_len = in_out.split("-")
          in_len = int(in_out_len[0])
          out_len = int(in_out_len[1])
          input_str = open(f"prompt/{in_len}.txt", "r").read()
          # As different tokenizer has different encodings,
          # slice the input_ids to ensure the prompt length is required length.
          n_ctx = in_len + out_len if in_len + out_len > 512 else 512
          for i in range(num_trials + warm_up):
              model = BigdlNativeForCausalLM.from_pretrained(
                  bigdl_llm_path, model_family=family, n_ctx=n_ctx
              )
              input_ids = model.tokenize(input_str)
              input_ids = input_ids[:in_len]
              true_input = model.batch_decode(input_ids)
              st = time.perf_counter()
              output = model(true_input, max_tokens=out_len)
              end = time.perf_counter()
              print("model generate cost: " + str(end - st))
              print(output)
  
      os.remove(bigdl_llm_path)
  
imports: import torch
  import time
  import gc
  import traceback
  import threading
  import numpy
  from datetime import date
  import os
  import sys
  from benchmark_util import BenchmarkWrapper
  from bigdl.llm.utils.common.log4Error import invalidInputError
label_desc: Use image node_id 4 for calling a global function with example usage: run_native_int4(repo_id, local_model_hub, in_out_pairs, warm_up, num_trials) without return types