class_docstr: This is the configuration class to store the configuration of a [`GPTNeoModel`]. It is used to instantiate a GPT
  Neo 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 GPTNeo
  [EleutherAI/gpt-neo-1.3B](https://huggingface.co/EleutherAI/gpt-neo-1.3B) 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 50257):
          Vocabulary size of the GPT Neo model. Defines the number of different tokens that can be represented by the
          `inputs_ids` passed when calling [`GPTNeoModel`]. Vocabulary size of the model. Defines the different
          tokens that can be represented by the *inputs_ids* passed to the forward method of [`GPTNeoModel`].
      attention_types (`List`, *optional*, defaults to `[[["global", "local"], 12]]`):
          The type of attention for each layer in a `List` of the following format `[[["attention_type"],
          num_layerss]]` e.g. for a 24 layer model `[[["global"], 24]]` or `[[["global", "local"], 12]]` Choose the
          value of `attention_type` from `["global", "local"]`
      hidden_size (`int`, *optional*, defaults to 2048):
          Dimensionality of the encoder layers and the pooler layer.
      num_layers (`int`, *optional*, defaults to 24):
          Number of hidden layers in the Transformer encoder.
      num_heads (`int`, *optional*, defaults to 16):
          Number of attention heads for each attention layer in the Transformer encoder.
      intermediate_size (`int`, *optional*, defaults to 8192):
          Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
      activation_function (`str` or `function`, *optional*, defaults to `"gelu_new"`):
          The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
          `"relu"`, `"selu"` and `"gelu_new"` are supported.
      embed_dropout (`float`, *optional*, defaults to 0.0):
          The dropout probabilitiy for all fully connected layers in the embeddings, encoder, and pooler.
      attention_dropout (`float`, *optional*, defaults to 0.0):
          The dropout ratio for the attention probabilities.
      max_position_embeddings (`int`, *optional*, defaults to 2048):
          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).
      type_vocab_size (`int`, *optional*, defaults to 2):
          The vocabulary size of the `token_type_ids` passed when calling [`GPTNeoModel`].
      initializer_range (`float`, *optional*, defaults to 0.02):
          The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
      layer_norm_epsilon (`float`, *optional*, defaults to 1e-5):
          The epsilon used by the layer normalization layers.
      use_cache (`bool`, *optional*, defaults to `True`):
          Whether or not the model should return the last key/values attentions (not used by all models). Only
          relevant if `config.is_decoder=True`.
  
  Example:
  
  ```python
  >>> from transformers import GPTNeoConfig, GPTNeoModel
  
  >>> # Initializing a GPTNeo EleutherAI/gpt-neo-1.3B style configuration
  >>> configuration = GPTNeoConfig()
  
  >>> # Initializing a model (with random weights) from the EleutherAI/gpt-neo-1.3B style configuration
  >>> model = GPTNeoModel(configuration)
  
  >>> # Accessing the model configuration
  >>> configuration = model.config
  ```
class_docstr_tok: ["This","is","the","configuration","class","to","store","the","configuration","of","a","[","`","GPTNeoModel","`","]",".","It","is","used","to","instantiate","a","GPT","Neo","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","GPTNeo","[","EleutherAI\/gpt-neo-1.3B","]","(","https",":","\/\/huggingface.co\/EleutherAI\/gpt-neo-1.3B",")","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","50257",")",":","Vocabulary","size","of","the","GPT","Neo","model",".","Defines","the","number","of","different","tokens","that","can","be","represented","by","the","`","inputs_ids","`","passed","when","calling","[","`","GPTNeoModel","`","]",".","Vocabulary","size","of","the","model",".","Defines","the","different","tokens","that","can","be","represented","by","the","*","inputs_ids","*","passed","to","the","forward","method","of","[","`","GPTNeoModel","`","]",".","attention_types","(","`","List","`",",","*","optional","*",",","defaults","to","`","[","[","[","``","global","''",",","``","local","''","]",",","12","]","]","`",")",":","The","type","of","attention","for","each","layer","in","a","`","List","`","of","the","following","format","`","[","[","[","``","attention_type","''","]",",","num_layerss","]","]","`","e.g",".","for","a","24","layer","model","`","[","[","[","``","global","''","]",",","24","]","]","`","or","`","[","[","[","``","global","''",",","``","local","''","]",",","12","]","]","`","Choose","the","value","of","`","attention_type","`","from","`","[","``","global","''",",","``","local","''","]","`","hidden_size","(","`","int","`",",","*","optional","*",",","defaults","to","2048",")",":","Dimensionality","of","the","encoder","layers","and","the","pooler","layer",".","num_layers","(","`","int","`",",","*","optional","*",",","defaults","to","24",")",":","Number","of","hidden","layers","in","the","Transformer","encoder",".","num_heads","(","`","int","`",",","*","optional","*",",","defaults","to","16",")",":","Number","of","attention","heads","for","each","attention","layer","in","the","Transformer","encoder",".","intermediate_size","(","`","int","`",",","*","optional","*",",","defaults","to","8192",")",":","Dimensionality","of","the","``","intermediate","''","(","i.e.",",","feed-forward",")","layer","in","the","Transformer","encoder",".","activation_function","(","`","str","`","or","`","function","`",",","*","optional","*",",","defaults","to","`","``","gelu_new","''","`",")",":","The","non-linear","activation","function","(","function","or","string",")","in","the","encoder","and","pooler",".","If","string",",","`","``","gelu","''","`",",","`","``","relu","''","`",",","`","``","selu","''","`","and","`","``","gelu_new","''","`","are","supported",".","embed_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","probabilitiy","for","all","fully","connected","layers","in","the","embeddings",",","encoder",",","and","pooler",".","attention_dropout","(","`","float","`",",","*","optional","*",",","defaults","to","0.0",")",":","The","dropout","ratio","for","the","attention","probabilities",".","max_position_embeddings","(","`","int","`",",","*","optional","*",",","defaults","to","2048",")",":","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",")",".","type_vocab_size","(","`","int","`",",","*","optional","*",",","defaults","to","2",")",":","The","vocabulary","size","of","the","`","token_type_ids","`","passed","when","calling","[","`","GPTNeoModel","`","]",".","initializer_range","(","`","float","`",",","*","optional","*",",","defaults","to","0.02",")",":","The","standard","deviation","of","the","truncated_normal_initializer","for","initializing","all","weight","matrices",".","layer_norm_epsilon","(","`","float","`",",","*","optional","*",",","defaults","to","1e-5",")",":","The","epsilon","used","by","the","layer","normalization","layers",".","use_cache","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","the","model","should","return","the","last","key\/values","attentions","(","not","used","by","all","models",")",".","Only","relevant","if","`","config.is_decoder=True","`",".","Example",":","``","`","python",">",">",">","from","transformers","import","GPTNeoConfig",",","GPTNeoModel",">",">",">","#","Initializing","a","GPTNeo","EleutherAI\/gpt-neo-1.3B","style","configuration",">",">",">","configuration","=","GPTNeoConfig","(",")",">",">",">","#","Initializing","a","model","(","with","random","weights",")","from","the","EleutherAI\/gpt-neo-1.3B","style","configuration",">",">",">","model","=","GPTNeoModel","(","configuration",")",">",">",">","#","Accessing","the","model","configuration",">",">",">","configuration","=","model.config","``","`"]
code: def __init__(
      self,
      vocab_size=50257,
      max_position_embeddings=2048,
      hidden_size=2048,
      num_layers=24,
      attention_types=[[["global", "local"], 12]],
      num_heads=16,
      intermediate_size=None,
      window_size=256,
      activation_function="gelu_new",
      resid_dropout=0.0,
      embed_dropout=0.0,
      attention_dropout=0.0,
      layer_norm_epsilon=1e-5,
      initializer_range=0.02,
      summary_type="cls_index",
      summary_use_proj=True,
      summary_activation=None,
      summary_proj_to_labels=True,
      summary_first_dropout=0.1,
      use_cache=True,
      bos_token_id=50256,
      eos_token_id=50256,
      **kwargs,
  ):
      self.vocab_size = vocab_size
      self.max_position_embeddings = max_position_embeddings
      self.hidden_size = hidden_size
      self.num_layers = num_layers
      self.num_heads = num_heads
      self.intermediate_size = intermediate_size
      self.window_size = window_size
      self.activation_function = activation_function
      self.resid_dropout = resid_dropout
      self.embed_dropout = embed_dropout
      self.attention_dropout = attention_dropout
      self.layer_norm_epsilon = layer_norm_epsilon
      self.initializer_range = initializer_range
      self.summary_type = summary_type
      self.summary_use_proj = summary_use_proj
      self.summary_activation = summary_activation
      self.summary_first_dropout = summary_first_dropout
      self.summary_proj_to_labels = summary_proj_to_labels
      self.use_cache = use_cache
  
      self.bos_token_id = bos_token_id
      self.eos_token_id = eos_token_id
  
      self.attention_types = attention_types
      self.attention_layers = self.expand_attention_types_params(
          attention_types
      )
  
      if len(self.attention_layers) != self.num_layers:
          raise ValueError(
              "Configuration for convolutional module is incorrect. "
              "It is required that `len(config.attention_layers)` == `config.num_layers` "
              f"but is `len(config.attention_layers) = {len(self.attention_layers)}`, "
              f"`config.num_layers = {self.num_layers}`. "
              "`config.attention_layers` is prepared using `config.attention_types`. "
              "Please verify the value of `config.attention_types` argument."
          )
  
      super().__init__(
          bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs
      )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/gpt_neo/configuration_gpt_neo.py
imports: from collections import OrderedDict
  from typing import Any, Mapping, Optional
  from ...None import PreTrainedTokenizer, TensorType, is_torch_available
  from ...configuration_utils import PretrainedConfig
  from ...onnx import OnnxConfigWithPast
  from ...utils import logging
label_desc: Use image node_id 1 to create a new GPTNeoConfig object from inherited base classes: PretrainedConfig with example: obj = GPTNeoConfig(vocab_size, max_position_embeddings, hidden_size, num_layers, attention_types, num_heads, intermediate_size, window_size, activation_function, resid_dropout, embed_dropout, attention_dropout, layer_norm_epsilon, initializer_range, summary_type, summary_use_proj, summary_activation, summary_proj_to_labels, summary_first_dropout, use_cache, bos_token_id, eos_token_id)