code: def __init__(self, *args, **kwargs):
      super().__init__(*args, **kwargs)
      sess_options = rt.SessionOptions()
  
      self.model_dir = glob.glob(
          os.path.join(self.model_dir, "*.onnx")
      )[0]
  
      # Set graph optimization level to ORT_ENABLE_EXTENDED to enable bert optimization.
      sess_options.graph_optimization_level = (
          rt.GraphOptimizationLevel.ORT_ENABLE_EXTENDED
      )
  
      # To enable model serialization and store the optimized graph to desired location.
      sess_options.optimized_model_filepath = self.model_dir
      self.session = rt.InferenceSession(self.model_dir, sess_options)
      if "albert" in self.model_dir:
          self.tokenizer = AutoTokenizer.from_pretrained(
              "albert-base-uncased"
          )
      else:
          self.tokenizer = AutoTokenizer.from_pretrained(
              "bert-base-uncased"
          )
  
file_path: nboost/nboost/plugins/rerank/onnxbert.py
imports: from transformers import AutoTokenizer
  from typing import List
  import numpy
  from nboost.plugins.models.rerank.base import RerankModelPlugin
  from nboost import defaults
  import onnxruntime
  import glob
  import os
label_desc: Use image node_id 1 to create a new ONNXBertRerankModelPlugin object from inherited base classes: RerankModelPlugin with example: obj = ONNXBertRerankModelPlugin()