
    fTh                     `    S r SSKJr  SSKJr  \R
                  " \5      r " S S\5      rS/r	g)zOPT model configuration   )PretrainedConfig)loggingc                   b   ^  \ rS rSrSrSrS/r                    SU 4S jjrSrU =r	$ )	OPTConfig   a  
This is the configuration class to store the configuration of a [`OPTModel`]. It is used to instantiate a OPT 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 OPT
[facebook/opt-350m](https://huggingface.co/facebook/opt-350m) 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 50272):
        Vocabulary size of the OPT model. Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`OPTModel`]
    hidden_size (`int`, *optional*, defaults to 768):
        Dimensionality of the layers and the pooler layer.
    num_hidden_layers (`int`, *optional*, defaults to 12):
        Number of decoder layers.
    ffn_dim (`int`, *optional*, defaults to 3072):
        Dimensionality of the "intermediate" (often named feed-forward) layer in decoder.
    num_attention_heads (`int`, *optional*, defaults to 12):
        Number of attention heads for each attention layer in the Transformer decoder.
    activation_function (`str` or `function`, *optional*, defaults to `"relu"`):
        The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
        `"relu"`, `"silu"` and `"gelu_new"` are supported.
    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).
    do_layer_norm_before (`bool`, *optional*, defaults to `True`):
        Whether to perform layer normalization before the attention block.
    word_embed_proj_dim (`int`, *optional*):
        `word_embed_proj_dim` can be set to down-project word embeddings, *e.g.* `opt-350m`. Defaults to
        `hidden_size`.
    dropout (`float`, *optional*, defaults to 0.1):
        The dropout probability 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.
    layerdrop (`float`, *optional*, defaults to 0.0):
        The LayerDrop probability. See the [LayerDrop paper](see https://arxiv.org/abs/1909.11556) for more
        details.
    init_std (`float`, *optional*, defaults to 0.02):
        The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
    use_cache (`bool`, *optional*, defaults to `True`):
        Whether or not the model should return the last key/values attentions (not used by all models).
    enable_bias (`bool`, *optional*, defaults to `True`):
        Whether or not if the linear layers in the attention blocks should use the bias term.
    layer_norm_elementwise_affine (`bool`, *optional*, defaults to `True`):
        Whether or not if the layer norms should have learnable parameters.

Example:

```python
>>> from transformers import OPTConfig, OPTModel

>>> # Initializing a OPT facebook/opt-large style configuration
>>> configuration = OPTConfig()

>>> # Initializing a model (with random weights) from the facebook/opt-large style configuration
>>> model = OPTModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```optpast_key_valuesc                 
  > [         TU ]  " SUUUS.UD6  Xl        XPl        Xl        Ub  UOUU l        X@l        X l        X0l        Xl	        Xl
        Xl        Xl        Xl        Xl        X`l        UU l        UU l        Xpl        g )N)pad_token_idbos_token_ideos_token_id )super__init__
vocab_sizemax_position_embeddingsnum_attention_headsword_embed_proj_dimffn_dimhidden_sizenum_hidden_layersdropoutattention_dropoutactivation_functioninit_std	layerdrop	use_cachedo_layer_norm_beforeenable_biaslayer_norm_elementwise_affine_remove_final_layer_norm)selfr   r   r   r   r   r   r!   r   r   r   r   r   r   r   r   r   r   r   r   r    kwargs	__class__s                         a/var/www/auris/envauris/lib/python3.13/site-packages/transformers/models/opt/configuration_opt.pyr   OPTConfig.__init__\   s    0 	 	
%%%	
 		
 %'>$#6 :M:Y#6_j &!2!2#6  ""$8!&-J*
 )A%    )r!   r   r   r   r   r   r   r   r   r    r   r   r   r   r   r   r   )i`  i      i   i   TFNg?        r(   relur)   g{Gz?T      r,   TT)
__name__
__module____qualname____firstlineno____doc__
model_typekeys_to_ignore_at_inferencer   __static_attributes____classcell__)r$   s   @r%   r   r      sc    >@ J#4"5  $!!& "&*+3A 3Ar'   r   N)
r1   configuration_utilsr   utilsr   
get_loggerr-   loggerr   __all__r   r'   r%   <module>r;      s=     3  
		H	%wA  wAt -r'   