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 = FSMTTokenizer.from_pretrained("facebook/wmt19-en-de")
  
      print("creating lightseq model...")
      # change to "lightseq_bart_large.hdf5" for large model
      # ls_model = lsi.Transformer("lightseq_bart_base.hdf5", 128)
      ls_model = None
      print("creating huggingface model...")
      # change to "facebook/bart-large" for large model
      hf_model = FSMTForConditionalGeneration.from_pretrained(
          "facebook/wmt19-en-de"
      )
      hf_model.to("cuda:0")
      hf_model.eval()
      hf_model.half()
  
      sentences = [
          "I love that girl, but she does not love me.",
      ]
  
      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"]
          input_len = inputs_id.size()[1]
          batch_size = 32
          input_seq_len = output_seq_len = 64
          repeat_factor = (input_seq_len // input_len + 1) * input_len
  
          inputs_id = inputs_id.repeat(batch_size, repeat_factor)
          inputs_id = inputs_id[:, :input_seq_len]
          print("input size:", inputs_id.size())
          hf_generate(hf_model, tokenizer, inputs_id)
  
          if not args.user_input:
              break
  
file_path: lightseq/examples/inference/python/test/ls_bart_bench.py
imports: import time
  import argparse
  import torch
  import lightseq.inference
  from transformers import FSMTForConditionalGeneration, FSMTTokenizer
label_desc: Use image node_id 6 for calling a global function with example usage: main() without return types