class_docstr: PyTorch implementation containing all the modelling needed for your NLP task. Combines a language
  model and a prediction head. Allows for gradient flow back to the language model component.
class_docstr_tok: ["PyTorch","implementation","containing","all","the","modelling","needed","for","your","NLP","task",".","Combines","a","language","model","and","a","prediction","head",".","Allows","for","gradient","flow","back","to","the","language","model","component","."]
docstr: Verifies that the model fits to the tokenizer vocabulary.
  They could diverge in case of custom vocabulary added via tokenizer.add_tokens()
code: def verify_vocab_size(self, vocab_size):
      """Verifies that the model fits to the tokenizer vocabulary.
      They could diverge in case of custom vocabulary added via tokenizer.add_tokens()
      """
  
      model_vocab_len = (
          self.language_model.model.resize_token_embeddings(
              new_num_tokens=None
          ).num_embeddings
      )
  
      msg = (
          f"Vocab size of tokenizer {vocab_size} doesn't match with model {model_vocab_len}. "
          "If you added a custom vocabulary to the tokenizer, "
          "make sure to supply 'n_added_tokens' to LanguageModel.load() and BertStyleLM.load()"
      )
      assert vocab_size == model_vocab_len, msg
  
      for head in self.prediction_heads:
          if head.model_type == "language_modelling":
              ph_decoder_len = head.decoder.weight.shape[0]
              assert vocab_size == ph_decoder_len, msg
  
imports: import copy
  import json
  import logging
  import os
  from pathlib import Path
  import multiprocessing
  import numpy
  import torch
  from torch import nn
  from transformers import AutoConfig
  from transformers.convert_graph_to_onnx import convert, quantize
  from farm.data_handler.processor import Processor
  from farm.modeling.language_model import LanguageModel
  from farm.modeling.prediction_head import PredictionHead, pick_single_fn
  from farm.utils import MLFlowLogger, stack
  import farm.conversion.transformers
label_desc: Use image node_id 12 for calling the AdaptiveModel obj's underlying member method code with example usage: obj.verify_vocab_size(vocab_size) without return types