code: def __init__(self, params, tokenizer):
      super(CrossEncoderModule, self).__init__()
      model_path = params["bert_model"]
      if params.get("roberta"):
          encoder_model = RobertaModel.from_pretrained(model_path)
      else:
          encoder_model = BertModel.from_pretrained(model_path)
      encoder_model.resize_token_embeddings(len(tokenizer))
      self.encoder = BertEncoder(
          encoder_model,
          params["out_dim"],
          layer_pulled=params["pull_from_layer"],
          add_linear=params["add_linear"],
      )
      self.config = self.encoder.bert_model.config
  
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from collections import OrderedDict
  from tqdm import tqdm
  from pytorch_transformers.modeling_utils import CONFIG_NAME, WEIGHTS_NAME
  from pytorch_transformers.modeling_bert import BertPreTrainedModel, BertConfig, BertModel
  from pytorch_transformers.modeling_roberta import RobertaConfig, RobertaModel
  from pytorch_transformers.tokenization_bert import BertTokenizer
  from pytorch_transformers.tokenization_roberta import RobertaTokenizer
  from blink.common.ranker_base import BertEncoder, get_model_obj
  from blink.common.optimizer import get_bert_optimizer
  from blink.common.params import ENT_START_TAG, ENT_END_TAG, ENT_TITLE_TAG
label_desc: Use image node_id 1 to create a new CrossEncoderModule object from inherited base classes: torch.nn with example: obj = CrossEncoderModule(params, tokenizer)