class_docstr: Configuration class to store the configuration of a `MMBT Model`.
  Args:
      config (:obj:`~transformers.PreTrainedConfig`):
          Config of the underlying Transformer models. Its values are
          copied over to use a single config.
      num_labels (:obj:`int` or :obj:`None`, optional, defaults to `None`):
          Size of final Linear layer for classification.
      modal_hidden_size (:obj:`int`, optional, defautls to 2048):
          Embedding dimension of the non-text modality encoder.
class_docstr_tok: ["Configuration","class","to","store","the","configuration","of","a","`","MMBT","Model","`",".","Args",":","config","(",":","obj",":","`","~transformers.PreTrainedConfig","`",")",":","Config","of","the","underlying","Transformer","models",".","Its","values","are","copied","over","to","use","a","single","config",".","num_labels","(",":","obj",":","`","int","`","or",":","obj",":","`","None","`",",","optional",",","defaults","to","`","None","`",")",":","Size","of","final","Linear","layer","for","classification",".","modal_hidden_size","(",":","obj",":","`","int","`",",","optional",",","defautls","to","2048",")",":","Embedding","dimension","of","the","non-text","modality","encoder","."]
code: def __init__(self, config, num_labels=None, modal_hidden_size=2048):
      self.__dict__ = config.__dict__
      self.modal_hidden_size = modal_hidden_size
      if num_labels:
          self.num_labels = num_labels
  
imports: import os
  from copy import deepcopy
  from dataclasses import dataclass
  from typing import Dict, Optional, Union
  import torch
  from mmf.common.registry import registry
  from mmf.models.base_model import BaseModel
  from mmf.models.interfaces.mmbt import MMBTGridHMInterface
  from mmf.modules.encoders import EncoderFactory, ImageEncoderFactory, ImageEncoderTypes, MultiModalEncoderBase, ResNet152ImageEncoder, TextEncoderFactory, TextEncoderTypes, TransformerEncoder
  from mmf.modules.hf_layers import replace_with_jit
  from mmf.utils.checkpoint import load_pretrained_model
  from mmf.utils.configuration import get_mmf_cache_dir
  from mmf.utils.modeling import get_optimizer_parameters_for_bert
  from omegaconf import DictConfig, II, OmegaConf
  from torch import nn, Tensor
label_desc: Use image node_id 1 to create a new MMBTConfig object  with example: obj = MMBTConfig(config, num_labels, modal_hidden_size)