U
    ,-e                     @   sB   d Z ddlmZ ddlmZ eeZddiZG dd deZ	dS )	z Salesforce CTRL configuration   )PretrainedConfig)loggingzSalesforce/ctrlz?https://huggingface.co/Salesforce/ctrl/resolve/main/config.jsonc                       s:   e Zd ZdZdZdgZdddddZd fdd	Z  ZS )
CTRLConfiga
  
    This is the configuration class to store the configuration of a [`CTRLModel`] or a [`TFCTRLModel`]. It is used to
    instantiate a CTRL 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
    [Salesforce/ctrl](https://huggingface.co/Salesforce/ctrl) architecture from SalesForce.

    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 246534):
            Vocabulary size of the CTRL model. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed when calling [`CTRLModel`] or [`TFCTRLModel`].
        n_positions (`int`, *optional*, defaults to 256):
            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).
        n_embd (`int`, *optional*, defaults to 1280):
            Dimensionality of the embeddings and hidden states.
        dff (`int`, *optional*, defaults to 8192):
            Dimensionality of the inner dimension of the feed forward networks (FFN).
        n_layer (`int`, *optional*, defaults to 48):
            Number of hidden layers in the Transformer encoder.
        n_head (`int`, *optional*, defaults to 16):
            Number of attention heads for each attention layer in the Transformer encoder.
        resid_pdrop (`float`, *optional*, defaults to 0.1):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        embd_pdrop (`int`, *optional*, defaults to 0.1):
            The dropout ratio for the embeddings.
        layer_norm_epsilon (`float`, *optional*, defaults to 1e-6):
            The epsilon to use in the layer normalization layers
        initializer_range (`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).


    Examples:

    ```python
    >>> from transformers import CTRLConfig, CTRLModel

    >>> # Initializing a CTRL configuration
    >>> configuration = CTRLConfig()

    >>> # Initializing a model (with random weights) from the configuration
    >>> model = CTRLModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ZctrlZpast_key_valuesn_positionsn_embdn_headn_layer)Zmax_position_embeddingsZhidden_sizeZnum_attention_headsZnum_hidden_layers           0      皙?ư>{Gz?Tc                    sT   || _ || _|| _|| _|| _|| _|| _|| _|	| _|
| _	|| _
t jf | d S )N)
vocab_sizer   r   r   r   dffresid_pdrop
embd_pdroplayer_norm_epsiloninitializer_range	use_cachesuper__init__)selfr   r   r   r   r   r   r   r   r   r   r   kwargs	__class__ l/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/transformers/models/ctrl/configuration_ctrl.pyr   Y   s    zCTRLConfig.__init__)r	   r
   r   r   r   r   r   r   r   r   T)	__name__
__module____qualname____doc__Z
model_typeZkeys_to_ignore_at_inferenceZattribute_mapr   __classcell__r   r   r   r    r      s(   3	           r   N)
r$   Zconfiguration_utilsr   utilsr   Z
get_loggerr!   loggerZ"CTRL_PRETRAINED_CONFIG_ARCHIVE_MAPr   r   r   r   r    <module>   s   
 