Ë
    ÛÓ^j  ã                   ój   — d 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y
)z&Funnel Transformer model configurationé    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringzfunnel-transformer/small)Ú
checkpointc                   ó  ‡ — e Zd ZU dZdZdddœZdZeed<   dZ	e
e   eed	f   z  ed
<   dZe
e   dz  ed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeed<   dZeez  ed<   dZeez  ed<   dZeez  ed<   dZeed<   dZedz  ed<   dZeed<   d Zeed!<   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ed)<   ˆ fd*„Z#d+„ Z$e%d,„ «       Z&e&jN                  d-„ «       Z&e%d.„ «       Z(e(jN                  d/„ «       Z(ˆ xZ)S )0ÚFunnelConfiga  
    block_sizes (`list[int]`, *optional*, defaults to `[4, 4, 4]`):
        The sizes of the blocks used in the model.
    block_repeats (`list[int]`, *optional*):
        If passed along, each layer of each block is repeated the number of times indicated.
    num_decoder_layers (`int`, *optional*, defaults to 2):
        The number of layers in the decoder (when not using the base model).
    pooling_type (`str`, *optional*, defaults to `"mean"`):
        Possible values are `"mean"` or `"max"`. The way pooling is performed at the beginning of each block.
    attention_type (`str`, *optional*, defaults to `"relative_shift"`):
        Possible values are `"relative_shift"` or `"factorized"`. The former is faster on CPU/GPU while the latter
        is faster on TPU.
    separate_cls (`bool`, *optional*, defaults to `True`):
        Whether or not to separate the cls token when applying pooling.
    truncate_seq (`bool`, *optional*, defaults to `True`):
        When using `separate_cls`, whether or not to truncate the last token when pooling, to avoid getting a
        sequence length that is not a multiple of 2.
    pool_q_only (`bool`, *optional*, defaults to `True`):
        Whether or not to apply the pooling only to the query or to query, key and values for the attention layers.
    ÚfunnelÚd_modelÚn_head)Úhidden_sizeÚnum_attention_headsi:w  Ú
vocab_size)é   r   r   .Úblock_sizesNÚblock_repeatsé   Únum_decoder_layersi   é   é@   Úd_headi   Úd_innerÚgelu_newÚ
hidden_actgš™™™™™¹?Úhidden_dropoutÚattention_dropoutg        Úactivation_dropoutÚinitializer_rangeÚinitializer_stdg•Ö&è.>Úlayer_norm_epsÚmeanÚpooling_typeÚrelative_shiftÚattention_typeTÚseparate_clsÚtruncate_seqÚpool_q_onlyÚpad_token_idÚtie_word_embeddingsc                 ó�   •— | j                   €dgt        | j                  «      z  n| j                   | _         t        ‰| �  di |¤Ž y )Né   © )r   Úlenr   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úz/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/funnel/configuration_funnel.pyr/   zFunnelConfig.__post_init__K   sA   ø€ Ø<@×<NÑ<NÐ<V˜a˜S¤3 t×'7Ñ'7Ó#8Ò8Ð\`×\nÑ\nˆÔÜ‰ÑÑ' Ó'ó    c                 ó  — t        | j                  «      t        | j                  «      k7  rt        d«      ‚| j                  dvrt        d| j                  › d�«      ‚| j
                  dvrt        d| j
                  › d�«      ‚y)zOPart of `@strict`-powered validation. Validates the architecture of the config.z>`block_sizes` and `block_repeats` should have the same length.)r!   ÚmaxzGot z< for `pooling_type` but only 'mean' and 'max' are supported.)r#   Ú
factorizedzO for `attention_type` but only 'relative_shift' and 'factorized' are supported.N)r-   r   r   Ú
ValueErrorr"   r$   ©r0   s    r3   Úvalidate_architecturez"FunnelConfig.validate_architectureO   s˜   € äˆt×ÑÓ ¤C¨×(:Ñ(:Ó$;Ò;ÜÐ]Ó^Ð^Ø×Ñð %
ñ 
ô ˜t D×$5Ñ$5Ð#6Ð6rÐsÓtÐtØ×Ñð '
ñ 
ô Ø�t×*Ñ*Ð+Ð+zÐ{óð ð	
r4   c                 ó,   — t        | j                  «      S ©N)Úsumr   r9   s    r3   Únum_hidden_layerszFunnelConfig.num_hidden_layers`   ó   € ä�4×#Ñ#Ó$Ð$r4   c                 ó   — t        d«      ‚)NzYThis model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.©ÚNotImplementedError©r0   Úvalues     r3   r>   zFunnelConfig.num_hidden_layersd   s   € ä!Øgó
ð 	
r4   c                 ó,   — t        | j                  «      S r<   )r-   r   r9   s    r3   Ú
num_blockszFunnelConfig.num_blocksj   r?   r4   c                 ó   — t        d«      ‚)NzRThis model does not support the setting of `num_blocks`. Please set `block_sizes`.rA   rC   s     r3   rF   zFunnelConfig.num_blocksn   s   € ä!Ð"vÓwÐwr4   )*Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚattribute_mapr   ÚintÚ__annotations__r   ÚlistÚtupler   r   r   r   r   r   r   Ústrr   Úfloatr   r   r   r   r    r"   r$   r%   Úboolr&   r'   r(   r)   r/   r:   Úpropertyr>   ÚsetterrF   Ú__classcell__)r2   s   @r3   r	   r	      s•  ø… ñð* €Jà Ø'ñ€Mð
 €J�ÓØ/8€K��c‘˜U 3¨ 8™_Ñ,Ó8Ø&*€M�4˜‘9˜tÑ#Ó*ØÐ˜ÓØ€GˆSÓØ€FˆCÓØ€FˆCÓØ€GˆSÓØ €J�Ó Ø"%€N�E˜C‘KÓ%Ø%(Ð�u˜s‘{Ó(Ø&)Ð˜ ™Ó)Ø"Ð�uÓ"Ø$(€O�U˜T‘\Ó(Ø €N�EÓ Ø€L�#ÓØ*€N�CÓ*Ø€L�$ÓØ€L�$ÓØ€K�ÓØ#€L�#˜‘*Ó#Ø $Ð˜Ó$ô(òð" ñ%ó ð%ð ×Ññ
ó ð
ð
 ñ%ó ð%ð ×Ññxó ôxr4   r	   N)	rK   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   Ú__all__r,   r4   r3   ú<module>r\      sN   ðñ -å .å 3Ý #ñ Ð5Ô6ØôXxÐ#ó Xxó ó 7ðXxðv Ð
�r4   