
    g1                     ^    d Z ddlmZ ddlmZ  ej        e          Z G d de          ZdS )zSalesforce CTRL configuration   )PretrainedConfig)loggingc                   R     e Zd ZdZdZdgZdddddZ	 	 	 	 	 	 	 	 	 	 	 d fd	Z x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-06):
            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
    ```ctrlpast_key_valuesn_positionsn_embdn_headn_layer)max_position_embeddingshidden_sizenum_attention_headsnum_hidden_layers           0      皙?ư>{Gz?Tc                     || _         || _        || _        || _        || _        || _        || _        || _        |	| _        |
| _	        || _
         t                      j        di | 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__s                g/var/www/html/ai-engine/env/lib/python3.11/site-packages/transformers/models/ctrl/configuration_ctrl.pyr$   zCTRLConfig.__init__U   sy     %&&$"4!2"""6"""""    )r   r   r   r   r   r   r   r   r   r   T)	__name__
__module____qualname____doc__
model_typekeys_to_ignore_at_inferenceattribute_mapr$   __classcell__)r'   s   @r(   r   r      s        1 1f J#4"5#0'&	 M # # # # # # # # # #r)   r   N)	r-   configuration_utilsr   utilsr   
get_loggerr*   loggerr   r   r)   r(   <module>r6      s    $ # 3 3 3 3 3 3       
	H	%	%Y# Y# Y# Y# Y#! Y# Y# Y# Y# Y#r)   