code: def main():
      parser = argparse.ArgumentParser()
      parser.add_argument("--user_input", action="store_true")
      args = parser.parse_args()
  
      print("initializing bart tokenizer...")
      # change to "facebook/bart-large" for large model
      tokenizer = BartTokenizer.from_pretrained("facebook/bart-base")
  
      print("creating lightseq model...")
      # change to "lightseq_bart_large.hdf5" for large model
      ls_model = lsi.Transformer("lightseq_bart_base.hdf5", 128)
      print("creating huggingface model...")
      # change to "facebook/bart-large" for large model
      hf_model = BartForConditionalGeneration.from_pretrained(
          "facebook/bart-base"
      )
      hf_model.to("cuda:0")
      hf_model.eval()
  
      sentences = [
          "I love that girl, but <mask> does not <mask> me.",
          "She is so <mask> that I can not help glance at <mask>.",
          "Nothing's gonna <mask> my love for you.",
          "Drop everything now. Meet me in the pouring <mask>. Kiss me on the sidewalk.",
      ]
  
      print("====================START warmup====================")
      warmup(tokenizer, ls_model, hf_model, sentences)
      print("====================END warmup====================")
  
      while True:
          if args.user_input:
              sentences = [input("input the masked sentence:\n")]
  
          print("tokenizing the sentences...")
          inputs = tokenizer(
              sentences, return_tensors="pt", padding=True
          )
          inputs_id = inputs["input_ids"]
  
          ls_generate(ls_model, tokenizer, inputs_id)
          hf_generate(hf_model, tokenizer, inputs_id)
  
          if not args.user_input:
              break
  
file_path: lightseq/examples/inference/python/test/ls_bart.py
imports: import time
  import argparse
  import torch
  import lightseq.inference
  from transformers import BartTokenizer, BartForConditionalGeneration
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types