code: def main():
      args = parse_args()
      model_name = ".".join(args.model.split(".")[:-1])
      ckpt_path = f"{model_name}.bin"
  
      print("initializing bert config...")
      config = BertConfig.from_pretrained(
          "bert-base-uncased", num_labels=9, finetuning_task="ner"
      )
  
      print("initializing bert tokenizer...")
      tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
  
      print("creating huggingface model...")
      hf_model = BertForTokenClassification.from_pretrained(
          "bert-base-uncased", config=config
      )
      inject_ls_layer(hf_model, config)
      state_dict = torch.load(ckpt_path, map_location="cpu")
      hf_model.load_state_dict(state_dict, strict=False)
      hf_model.to("cuda:0")
      hf_model.eval()
  
      print("creating lightseq model...")
      ls_model = LightseqBertClassification(args.model, hf_model)
  
      sentences = [
          "EU rejects German call to boycott British lamb .",
          "-- Dimitris Kontogiannis , Athens Newsroom +301 3311812-4",
          "BayerVB sets C$ 100 million six-year bond .",
          "China says time right for Taiwan talks .",
      ]
  
      print("====================START warmup====================")
      warmup(tokenizer, ls_model, hf_model, sentences)
      print("====================END warmup====================")
  
      print("tokenizing the sentences...")
      inputs = tokenizer(sentences, return_tensors="pt", padding=True)
      inputs_id = inputs["input_ids"]
      attn_mask = inputs["attention_mask"]
  
      ls_generate(ls_model, inputs_id)
      hf_generate(hf_model, inputs_id, attn_mask)
  
imports: import time
  import torch
  from transformers import BertTokenizer, BertForTokenClassification, BertConfig
  import lightseq.inference
  from lightseq.training.ops.pytorch.quantization import qat_mode
  from lightseq.training.ops.pytorch.torch_transformer_layers import BertEmbeddingLayer, TransformerEncoderLayer
  from export.util import parse_args
label_desc: Use image node_id 9 for calling a global function with example usage: main() without return types