§
    ‚Štj=  ã                   ó�   — d Z ddlmZ ddlmZ ddlmZ ddlmZ  ed¬¦  «        e G d	„ d
e¦  «        ¦   «         ¦   «         Z	d
gZ
dS )zFalcon configurationé    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringztiiuae/falcon-7b)Ú
checkpointc                   ó.  ‡ — e Zd ZU dZdZdgZdZeed<   dZ	eed<   dZ
eed	<   d
Zeed<   dZedz  ed<   dZedz  ed<   dZeed<   dZeed<   dZeez  dz  ed<   dZeez  dz  ed<   dZedz  ed<   dZedz  ed<   dZedz  ed<   dZedz  ed<   dZedz  ed<   dZedz  ed<   dZeed<   dZeez  dz  ed <   d!Zedz  ed"<   d!Zee e         z  dz  ed#<   dZ!edz  ed$<   dZ"edz  ed%<   d&Z#e$dz  ed'<   dZ%eed(<   ˆ fd)„Z&e'd*„ ¦   «         Z(e'd+„ ¦   «         Z)ˆ xZ*S ),ÚFalconConfiga  
    num_ln_in_parallel_attn (`int`, *optional*):
        Set to 2 if separate layer norms are to be used for the MLP and the attention output when using parallel
        attention, otherwise, 1.
    alibi (`bool`, *optional*, defaults to `False`):
        Whether to use ALiBi positional biases during self-attention.
    new_decoder_architecture (`bool`, *optional*, defaults to `False`):
        Whether to use the new (Falcon-40B) decoder architecture. If `True`, the `multi_query` and `parallel_attn`
        arguments are ignored, as the new decoder always uses parallel attention.
    multi_query (`bool`, *optional*, defaults to `True`):
        Whether to use multi-query attention in the decoder. Ignored when `new_decoder_architecture` is `True`.
    parallel_attn (`bool`, *optional*, defaults to `True`):
        Whether to compute attention in parallel with the feedforward layer. If False, they are consecutive
        instead, as in the original Transformer architecture. Ignored when `new_decoder_architecture` is `True`.
    bias (`bool`, *optional*, defaults to `False`):
        Whether to use bias on Linear layers.
    ffn_hidden_size (`int`, *optional*):
        The hidden size of the feedforward layer in the Transformer decoder.
        defaults to 4x hidden dim
    activation (`str`, *optional*, defaults to `"gelu"`):
        The activation function used in the feedforward layer.

    Example:

    ```python
    >>> from transformers import FalconModel, FalconConfig

    >>> # Initializing a small (2-layer) Falcon configuration
    >>> configuration = FalconConfig(num_hidden_layers=2)

    >>> # Initializing a model from the small configuration
    >>> model = FalconModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚfalconÚpast_key_valuesi þ  Ú
vocab_sizeiÀ  Úhidden_sizeé    Únum_hidden_layerséG   Únum_attention_headsNÚnum_ln_in_parallel_attngñhãˆµøä>Úlayer_norm_epsilong{®Gáz”?Úinitializer_rangeTÚ	use_cacheg        Úhidden_dropoutÚattention_dropoutÚnum_kv_headsFÚalibiÚnew_decoder_architectureÚmulti_queryÚparallel_attnÚbiasi   Úmax_position_embeddingsÚrope_parametersé   Úbos_token_idÚeos_token_idÚpad_token_idÚffn_hidden_sizeÚgeluÚ
activationÚtie_word_embeddingsc                 óæ   •— |                      dd ¦  «        }|€| j        n|| _        | j        €| j        n| j        | _        | j        €| j        dz  | _         t          ¦   «         j        di |¤Ž d S )NÚn_embedé   © )Úpopr   r   r   r%   ÚsuperÚ__post_init__)ÚselfÚkwargsr*   Ú	__class__s      €úm/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/falcon/configuration_falcon.pyr/   zFalconConfig.__post_init__[   s‚   ø€ à—*’*˜Y¨Ñ-Ô-ˆØ/6¨˜4Ô+Ð+ÀGˆÔØ8<Ô8IÐ8Q˜DÔ4Ð4ÐW[ÔWhˆÔØÔÐ'Ø#'Ô#3°aÑ#7ˆDÔ à�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c                 ó    — | j         | j        z  S ©N)r   r   ©r0   s    r3   Úhead_dimzFalconConfig.head_dime   s   € àÔ 4Ô#;Ñ;Ð;r4   c                 ó   — | j          S r6   )r   r7   s    r3   ÚrotaryzFalconConfig.rotaryi   s   € à”:ˆ~Ðr4   )+Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚkeys_to_ignore_at_inferencer   ÚintÚ__annotations__r   r   r   r   r   Úfloatr   r   Úboolr   r   r   r   r   r   r   r   r   r    r   Údictr"   r#   Úlistr$   r%   r'   Ústrr(   r/   Úpropertyr8   r:   Ú__classcell__)r2   s   @r3   r
   r
      sm  ø€ € € € € € ð#ð #ðJ €JØ#4Ð"5Ðà€J�ÐÐÑØ€K�ÐÐÑØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø*.Ð˜S 4™ZÐ.Ð.Ñ.Ø'+Ð˜ ™Ð+Ð+Ñ+Ø#Ð�uÐ#Ð#Ñ#Ø€IˆtÐÐÑØ),€N�E˜C‘K $Ñ&Ð,Ð,Ñ,Ø,/Ð�u˜s‘{ TÑ)Ð/Ð/Ñ/Ø#€L�#˜‘*Ð#Ð#Ñ#Ø€Eˆ4�$‰;ÐÐÑØ,1Ð˜d T™kÐ1Ð1Ñ1Ø#€K�˜‘Ð#Ð#Ñ#Ø!%€M�4˜$‘;Ð%Ð%Ñ%Ø€Dˆ$�‰+ÐÐÑØ#'Ð˜SÐ'Ð'Ñ'Ø48€O�^ dÑ*¨TÑ1Ð8Ð8Ñ8Ø!€L�#˜‘*Ð!Ð!Ñ!Ø+-€L�#˜˜Sœ	‘/ DÑ(Ð-Ð-Ñ-Ø#€L�#˜‘*Ð#Ð#Ñ#Ø"&€O�S˜4‘ZÐ&Ð&Ñ&Ø#€J��d‘
Ð#Ð#Ñ#Ø $Ð˜Ð$Ð$Ñ$ð(ð (ð (ð (ð (ð ð<ð <ñ „Xð<ð ðð ñ „Xðð ð ð ð r4   r
   N)r>   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r
   Ú__all__r,   r4   r3   ú<module>rO      s¼   ðð Ð à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð-Ð.Ñ.Ô.ØðRð Rð Rð Rð RÐ#ñ Rô Rñ „ñ /Ô.ðRðj Ð
€€€r4   