code: def save_model(self, output_dir):
      if not os.path.exists(output_dir):
          os.makedirs(output_dir)
      model_to_save = get_model_obj(self.model)
      output_model_file = os.path.join(output_dir, WEIGHTS_NAME)
      output_config_file = os.path.join(output_dir, CONFIG_NAME)
      torch.save(model_to_save.state_dict(), output_model_file)
      model_to_save.config.to_json_file(output_config_file)
  
imports: import os
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from tqdm import tqdm
  from pytorch_transformers.modeling_bert import BertPreTrainedModel, BertConfig, BertModel
  from pytorch_transformers.tokenization_bert import BertTokenizer
  from blink.common.ranker_base import BertEncoder, get_model_obj
  from blink.common.optimizer import get_bert_optimizer
label_desc: Use image node_id 4 for calling the BiEncoderRanker obj's underlying member method code with example usage: obj.save_model(output_dir) without return types