class_docstr: This is the configuration class to store the configuration of a [`FlavaTextModel`]. It is used to instantiate an
  FLAVA model according to the specified arguments, defining the model architecture.
  
  Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
  [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.
  
  Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
  documentation from [`PretrainedConfig`] for more information.
  
  
  Args:
      vocab_size (`int`, *optional*, defaults to 30522):
          Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
          `inputs_ids` passed when calling [`FlavaTextModel`].
      type_vocab_size (`int`, *optional*, defaults to 2):
          The vocabulary size of the `token_type_ids` passed when calling [`FlavaTextModel`]. Note that even though
          text encoder allows `token_type_ids`'s value as 2, for text-only pretraining and fine-tuning, only 1 is
          used similar to RoBERTa.
      max_position_embeddings (`int`, *optional*, defaults to 512):
          The maximum sequence length that this model might ever be used with. Typically set this to something large
          just in case (e.g., 512 or 1024 or 2048). For VL, max_length passed to model is 77.
      position_embedding_type (`str`, *optional*, defaults to `"absolute"`):
          Type of position embedding. Choose one of `"absolute"`, `"relative_key"`, `"relative_key_query"`. For
          positional embeddings use `"absolute"`. For more information on `"relative_key"`, please refer to
          [Self-Attention with Relative Position Representations (Shaw et al.)](https://arxiv.org/abs/1803.02155).
          For more information on `"relative_key_query"`, please refer to *Method 4* in [Improve Transformer Models
          with Better Relative Position Embeddings (Huang et al.)](https://arxiv.org/abs/2009.13658).
      hidden_size (`int`, *optional*, defaults to 768):
          Dimensionality of the encoder layers and the pooler layer.
      num_hidden_layers (`int`, *optional*, defaults to 12):
          Number of hidden layers in the Transformer encoder.
      num_attention_heads (`int`, *optional*, defaults to 12):
          Number of attention heads for each attention layer in the Transformer encoder.
      intermediate_size (`int`, *optional*, defaults to 3072):
          Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
      hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
          The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
          `"relu"`, `"selu"` and `"gelu_new"` are supported.
      hidden_dropout_prob (`float`, *optional*, defaults to 0.1):
          The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.
      attention_probs_dropout_prob (`float`, *optional*, defaults to 0.1):
          The dropout ratio for the attention probabilities.
      initializer_range (`float`, *optional*, defaults to 0.02):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      layer_norm_eps (`float`, *optional*, defaults to 1e-12):
          The epsilon used by the layer normalization layers.
      image_size (`int`, *optional*, defaults to 224):
          The size (resolution) of each image.
      patch_size (`int`, *optional*, defaults to 16):
          The size (resolution) of each patch.
      num_channels (`int`, *optional*, defaults to 3):
          The number of input channels.
      qkv_bias (`bool`, *optional*, defaults to `True`):
          Whether to add a bias to the queries, keys and values.
  
  Example:
  
  ```python
  >>> from transformers import FlavaTextConfig, FlavaTextModel
  
  >>> # Initializing a FlavaTextModel with  style configuration
  >>> configuration = FlavaTextConfig()
  
  >>> # Initializing a FlavaTextModel model (with random weights) from the style configuration
  >>> model = FlavaTextModel(configuration)
  
  >>> # Accessing the model configuration
  >>> configuration = model.config
  ```
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","a","[","`","FlavaTextModel","`","]",".","It","is","used","to","instantiate","an","FLAVA","model","according","to","the","specified","arguments",",","defining","the","model","architecture",".","Instantiating","a","configuration","with","the","defaults","will","yield","a","similar","configuration","to","that","of","the","FLAVA","[","facebook\/flava-full","]","(","https",":","\/\/huggingface.co\/facebook\/flava-full",")","architecture",".","Configuration","objects","inherit","from","[","`","PretrainedConfig","`","]","and","can","be","used","to","control","the","model","outputs",".","Read","the","documentation","from","[","`","PretrainedConfig","`","]","for","more","information",".","Args",":","vocab_size","(","`","int","`",",","*","optional","*",",","defaults","to","30522",")",":","Vocabulary","size","of","the","BERT","model",".","Defines","the","number","of","different","tokens","that","can","be","represented","by","the","`","inputs_ids","`","passed","when","calling","[","`","FlavaTextModel","`","]",".","type_vocab_size","(","`","int","`",",","*","optional","*",",","defaults","to","2",")",":","The","vocabulary","size","of","the","`","token_type_ids","`","passed","when","calling","[","`","FlavaTextModel","`","]",".","Note","that","even","though","text","encoder","allows","`","token_type_ids","`","'s","value","as","2",",","for","text-only","pretraining","and","fine-tuning",",","only","1","is","used","similar","to","RoBERTa",".","max_position_embeddings","(","`","int","`",",","*","optional","*",",","defaults","to","512",")",":","The","maximum","sequence","length","that","this","model","might","ever","be","used","with",".","Typically","set","this","to","something","large","just","in","case","(","e.g.",",","512","or","1024","or","2048",")",".","For","VL",",","max_length","passed","to","model","is","77.","position_embedding_type","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","absolute","''","`",")",":","Type","of","position","embedding",".","Choose","one","of","`","``","absolute","''","`",",","`","``","relative_key","''","`",",","`","``","relative_key_query","''","`",".","For","positional","embeddings","use","`","``","absolute","''","`",".","For","more","information","on","`","``","relative_key","''","`",",","please","refer","to","[","Self-Attention","with","Relative","Position","Representations","(","Shaw","et","al.",")","]","(","https",":","\/\/arxiv.org\/abs\/1803.02155",")",".","For","more","information","on","`","``","relative_key_query","''","`",",","please","refer","to","*","Method","4","*","in","[","Improve","Transformer","Models","with","Better","Relative","Position","Embeddings","(","Huang","et","al.",")","]","(","https",":","\/\/arxiv.org\/abs\/2009.13658",")",".","hidden_size","(","`","int","`",",","*","optional","*",",","defaults","to","768",")",":","Dimensionality","of","the","encoder","layers","and","the","pooler","layer",".","num_hidden_layers","(","`","int","`",",","*","optional","*",",","defaults","to","12",")",":","Number","of","hidden","layers","in","the","Transformer","encoder",".","num_attention_heads","(","`","int","`",",","*","optional","*",",","defaults","to","12",")",":","Number","of","attention","heads","for","each","attention","layer","in","the","Transformer","encoder",".","intermediate_size","(","`","int","`",",","*","optional","*",",","defaults","to","3072",")",":","Dimensionality","of","the","``","intermediate","''","(","i.e.",",","feed-forward",")","layer","in","the","Transformer","encoder",".","hidden_act","(","`","str","`","or","`","function","`",",","*","optional","*",",","defaults","to","`","``","gelu","''","`",")",":","The","non-linear","activation","function","(","function","or","string",")","in","the","encoder","and","pooler",".","If","string",",","`","``","gelu","''","`",",","`","``","relu","''","`",",","`","``","selu","''","`","and","`","``","gelu_new","''","`","are","supported",".","hidden_dropout_prob","(","`","float","`",",","*","optional","*",",","defaults","to","0.1",")",":","The","dropout","probabilitiy","for","all","fully","connected","layers","in","the","embeddings",",","encoder",",","and","pooler",".","attention_probs_dropout_prob","(","`","float","`",",","*","optional","*",",","defaults","to","0.1",")",":","The","dropout","ratio","for","the","attention","probabilities",".","initializer_range","(","`","float","`",",","*","optional","*",",","defaults","to","0.02",")",":","The","standard","deviation","of","the","truncated_normal_initializer","for","initializing","all","weight","matrices",".","layer_norm_eps","(","`","float","`",",","*","optional","*",",","defaults","to","1e-12",")",":","The","epsilon","used","by","the","layer","normalization","layers",".","image_size","(","`","int","`",",","*","optional","*",",","defaults","to","224",")",":","The","size","(","resolution",")","of","each","image",".","patch_size","(","`","int","`",",","*","optional","*",",","defaults","to","16",")",":","The","size","(","resolution",")","of","each","patch",".","num_channels","(","`","int","`",",","*","optional","*",",","defaults","to","3",")",":","The","number","of","input","channels",".","qkv_bias","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","add","a","bias","to","the","queries",",","keys","and","values",".","Example",":","``","`","python",">",">",">","from","transformers","import","FlavaTextConfig",",","FlavaTextModel",">",">",">","#","Initializing","a","FlavaTextModel","with","style","configuration",">",">",">","configuration","=","FlavaTextConfig","(",")",">",">",">","#","Initializing","a","FlavaTextModel","model","(","with","random","weights",")","from","the","style","configuration",">",">",">","model","=","FlavaTextModel","(","configuration",")",">",">",">","#","Accessing","the","model","configuration",">",">",">","configuration","=","model.config","``","`"]
code: def from_pretrained(
      cls,
      pretrained_model_name_or_path: Union[str, os.PathLike],
      **kwargs,
  ) -> "PretrainedConfig":
      config_dict, kwargs = cls.get_config_dict(
          pretrained_model_name_or_path, **kwargs
      )
  
      # get the text config dict if we are loading from FlavaConfig
      if config_dict.get("model_type") == "flava":
          config_dict = config_dict["text_config"]
  
      if (
          "model_type" in config_dict
          and hasattr(cls, "model_type")
          and config_dict["model_type"] != cls.model_type
      ):
          logger.warning(
              f"You are using a model of type {config_dict['model_type']} to instantiate a model of type "
              f"{cls.model_type}. This is not supported for all configurations of models and can yield errors."
          )
  
      return cls.from_dict(config_dict, **kwargs)
  
imports: import copy
  import os
  from typing import Any, Dict, Union
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
label_desc: Use image node_id 2 for calling the FlavaTextConfig obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrained_model_name_or_path) and returns: cls