class_docstr: This is the configuration class to store the configuration of a [`FlavaImageModel`]. 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:
      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.
      mask_token (`bool`, *optional*, defaults to `True`):
          Whether to use a mask token or not. Used in MIM (Masked Image Modeling) loss for FLAVA.
      vocab_size (`int`, *optional*, defaults to 8192):
          Vocabulary size of the [`FlavaImageCodebook`] used in conjunction with [`FlavaImageModel`] for MIM (Masked
          Image Modeling) loss for FLAVA.
  
  Example:
  
  ```python
  >>> from transformers import FlavaImageConfig, FlavaImageModel
  
  >>> # Initializing a FlavaImageModel with  style configuration
  >>> configuration = FlavaImageConfig()
  
  >>> # Initializing a FlavaImageModel model (with random weights) from the style configuration
  >>> model = FlavaImageModel(configuration)
  
  >>> # Accessing the model configuration
  >>> configuration = model.config
  ```
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","a","[","`","FlavaImageModel","`","]",".","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",":","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",".","mask_token","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","to","use","a","mask","token","or","not",".","Used","in","MIM","(","Masked","Image","Modeling",")","loss","for","FLAVA",".","vocab_size","(","`","int","`",",","*","optional","*",",","defaults","to","8192",")",":","Vocabulary","size","of","the","[","`","FlavaImageCodebook","`","]","used","in","conjunction","with","[","`","FlavaImageModel","`","]","for","MIM","(","Masked","Image","Modeling",")","loss","for","FLAVA",".","Example",":","``","`","python",">",">",">","from","transformers","import","FlavaImageConfig",",","FlavaImageModel",">",">",">","#","Initializing","a","FlavaImageModel","with","style","configuration",">",">",">","configuration","=","FlavaImageConfig","(",")",">",">",">","#","Initializing","a","FlavaImageModel","model","(","with","random","weights",")","from","the","style","configuration",">",">",">","model","=","FlavaImageModel","(","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 image config dict if we are loading from FlavaConfig
      if config_dict.get("model_type") == "flava":
          config_dict = config_dict["image_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 FlavaImageConfig obj's underlying member method code with example usage: obj.from_pretrained(cls, pretrained_model_name_or_path) and returns: cls