
    sg                     Z    d Z ddlmZ ddlmZ  ej
                  e      Z G d de      Zy)zCPMAnt model configuration   )PretrainedConfig)loggingc                        e Zd ZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddedededededed	ed
edededededededef fdZ xZ	S )CpmAntConfiga  
    This is the configuration class to store the configuration of a [`CpmAntModel`]. It is used to instantiate an
    CPMAnt 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 CPMAnt
    [openbmb/cpm-ant-10b](https://huggingface.co/openbmb/cpm-ant-10b) 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 30720):
            Vocabulary size of the CPMAnt model. Defines the number of different tokens that can be represented by the
            `input` passed when calling [`CpmAntModel`].
        hidden_size (`int`, *optional*, defaults to 4096):
            Dimension of the encoder layers.
        num_attention_heads (`int`, *optional*, defaults to 32):
            Number of attention heads in the Transformer encoder.
        dim_head (`int`, *optional*, defaults to 128):
            Dimension of attention heads for each attention layer in the Transformer encoder.
        dim_ff (`int`, *optional*, defaults to 10240):
            Dimension of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        num_hidden_layers (`int`, *optional*, defaults to 48):
            Number of layers of the Transformer encoder.
        dropout_p (`float`, *optional*, defaults to 0.0):
            The dropout probability for all fully connected layers in the embeddings, encoder.
        position_bias_num_buckets (`int`, *optional*, defaults to 512):
            The number of position_bias buckets.
        position_bias_max_distance (`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).
        eps (`float`, *optional*, defaults to 1e-06):
            The epsilon used by the layer normalization layers.
        init_std (`float`, *optional*, defaults to 1.0):
            Initialize parameters with std = init_std.
        prompt_types (`int`, *optional*, defaults to 32):
            The type of prompt.
        prompt_length (`int`, *optional*, defaults to 32):
            The length of prompt.
        segment_types (`int`, *optional*, defaults to 32):
            The type of segment.
        use_cache (`bool`, *optional*, defaults to `True`):
            Whether to use cache.

    Example:

    ```python
    >>> from transformers import CpmAntModel, CpmAntConfig

    >>> # Initializing a CPMAnt cpm-ant-10b style configuration
    >>> configuration = CpmAntConfig()

    >>> # Initializing a model from the cpm-ant-10b style configuration
    >>> model = CpmAntModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```cpmant
vocab_sizehidden_sizenum_attention_headsdim_headdim_ffnum_hidden_layers	dropout_pposition_bias_num_bucketsposition_bias_max_distanceepsinit_stdprompt_typesprompt_lengthsegment_types	use_cachec                     t        |   di | || _        || _        || _        || _        || _        || _        || _        || _	        || _
        |	| _        || _        |
| _        || _        || _        || _        y )N )super__init__r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   )selfr   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   kwargs	__class__s                    b/var/www/html/venv/lib/python3.12/site-packages/transformers/models/cpmant/configuration_cpmant.pyr   zCpmAntConfig.__init__U   s    & 	"6"(**&#6  !2)B&*D'""$     )i x  i          i (  0   g        i   i   gư>g      ?r    r    r    T)
__name__
__module____qualname____doc__
model_typeintfloatboolr   __classcell__)r   s   @r   r   r      s    8t J  #%!#),*.!"!"! "! !	"!
 "! "! "! "! $'"! %("! "! "! "! "! "!  !"! "!r   r   N)	r&   configuration_utilsr   utilsr   
get_loggerr#   loggerr   r   r   r   <module>r0      s3    ! 3  
		H	%_!# _!r   