Ë
    ÛÓ^j<  ã                   óÖ   — d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	  e	j                  e«      Z ed¬«      e G d	„ d
e«      «       «       Z ed¬«      e G d„ de«      «       «       ZdgZy)zEvolla model configurationé    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringÚloggingzwestlake-repl/Evolla-10B-hf)Ú
checkpointc                   ó  — e Zd ZU dZ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d<   dZeez  ed<   dZee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d <   dZeed!<   dZeed"<   y#)$ÚSaProtConfigaß  
    mask_token_id (`int`, *optional*, defaults to 4):
        The id of the *mask* token in the protein sequence model.
    position_embedding_type (`str`, *optional*, defaults to `"rotary"`):
        The type of position embedding to use in the protein sequence model. Currently only `"rotary"` is supported.
    rope_theta (`float`, *optional*, defaults to 10000.0):
        The base period of the RoPE embeddings.
    emb_layer_norm_before (`bool`, *optional*, defaults to `False`):
        Whether to apply layer normalization before the position embedding in the protein sequence model.
    token_dropout (`bool`, *optional*, defaults to `True`):
        Whether to apply dropout to the tokens in the protein sequence model.
    i¾  Ú
vocab_sizeé   Úmask_token_idé   Úpad_token_idi   Úhidden_sizeé!   Únum_hidden_layersé   Únum_attention_headsi   Úintermediate_sizeçš™™™™™¹?Úhidden_dropout_probÚattention_probs_dropout_probi  Úmax_position_embeddingsç{®Gáz”?Úinitializer_rangeçñhãˆµøä>Úlayer_norm_epsÚrotaryÚposition_embedding_typeg     ˆÃ@Ú
rope_thetaFÚemb_layer_norm_beforeTÚtoken_dropoutÚ
is_decoderÚadd_cross_attentionN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚintÚ__annotations__r   r   r   r   r   r   r   Úfloatr   r   r   r   r    Ústrr!   r"   Úboolr#   r$   r%   © ó    úz/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/evolla/configuration_evolla.pyr   r      sÏ   … ñð €J�ÓØ€M�3ÓØ€L�#ÓØ€K�ÓØÐ�sÓØ!Ð˜Ó!Ø!Ð�sÓ!Ø'*Ð˜ ™Ó*Ø03Ð  %¨#¡+Ó3Ø#'Ð˜SÓ'Ø#Ð�uÓ#Ø!€N�EÓ!Ø#+Ð˜SÓ+Ø€J�ÓØ"'Ð˜4Ó'Ø€M�4ÓØ€J�ÓØ %Ð˜Ô%r0   r   c                   óp  ‡ — e Zd ZU dZdZdeiZdZdZe	e
z  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dz  ed<   dZe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d<   dZeez  dz  ed<   dZe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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dz  ed-<   d.Z)edz  ed/<   d0Z*ee+e   z  dz  ed1<   dZ,eed2<   dZ-eed3<   dZ.edz  ed4<   dZ/edz  ed5<   ˆ fd6„Z0ˆ xZ1S )7ÚEvollaConfiga€  
    protein_encoder_config (`dict`, *optional*):
        Dictionary of configuration options used to initialize [`SaProtConfig`].
    aligner_ffn_mult (`int`, *optional*, defaults to 4):
        The FFN multiplier for the aligner layer.
    aligner_enable_bias (`bool`, *optional*, defaults to `True`):
        Whether to use bias in the aligner layer.
    aligner_attention_probs_dropout_prob (`float`, *optional*, defaults to 0.1):
        The dropout ratio for the attention probabilities in the aligner layer.
    aligner_num_add_layers (`int`, *optional*, defaults to 8):
        The number of additional layers for the aligner layer.
    resampler_depth (`int`, *optional*, defaults to 6):
        The depth of the resampler layer in the llama model.
    resampler_dim_head (`int`, *optional*, defaults to 64):
        The dimension of the heads in the resampler layer in the llama model.
    resampler_heads (`int`, *optional*, defaults to 8):
        The number of heads in the resampler layer in the llama model.
    resampler_num_latents (`int`, *optional*, defaults to 64):
        The number of latents in the resampler layer in the llama model.
    resampler_ff_mult (`int`, *optional*, defaults to 4):
        The FFN multiplier for the resampler layer.

    Example:

    ```python
    >>> from transformers import EvollaModel, EvollaConfig

    >>> # Initializing a Evolla evolla-10b style configuration
    >>> configuration = EvollaConfig()

    >>> # Initializing a model from the evolla-10b style configuration
    >>> model = EvollaModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚevollaÚprotein_encoder_configg    €„ANi õ r   i   r   i 8  r   é    r   r   é   Únum_key_value_headsÚsiluÚ
hidden_acti    r   r   Úrms_norm_epsÚrope_parametersFÚattention_biasg        Úattention_dropoutÚmlp_biasr   Úaligner_ffn_multTÚaligner_enable_biasr   Ú$aligner_attention_probs_dropout_probÚaligner_num_add_layersé   Úresampler_depthé@   Úresampler_dim_headÚresampler_headsÚresampler_num_latentsÚresampler_ff_multr   r   r   i ô Úbos_token_idi	ô Úeos_token_idÚ	use_cacheÚtie_word_embeddingsr$   r%   c                 óî   •— | j                   €%t        «       | _         t        j                  d«       n4t	        | j                   t
        «      rt        di | j                   ¤Ž| _         t        ‰| �  di |¤Ž y )NzX`protein_encoder_config` is `None`. Initializing the `SaProtConfig` with default values.r/   )r5   r   ÚloggerÚinfoÚ
isinstanceÚdictÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r1   rU   zEvollaConfig.__post_init__Š   s\   ø€ Ø×&Ñ&Ð.Ü*6«.ˆDÔ'Ü�K‰KÐrÕsÜ˜×3Ñ3´TÔ:Ü*6Ñ*U¸×9TÑ9TÑ*UˆDÔ'Ü‰ÑÑ' Ó'r0   )2r&   r'   r(   r)   Ú
model_typer   Úsub_configsÚdefault_thetar5   rS   r   r+   r   r*   r   r   r   r   r8   r:   r-   r   r;   r,   r<   r   r=   r.   r>   r?   r@   rA   rB   rC   rE   rG   rH   rI   rJ   r   r   rK   rL   ÚlistrM   rN   r$   r%   rU   Ú__classcell__)rX   s   @r1   r3   r3   >   sÓ  ø… ñ#ðJ €JØ+¨\Ð:€KØ€Mà=AÐ˜DÐ#3Ñ3°dÑ:ÓAØ€J�ÓØ€K�ÓØ"Ð�sÓ"ØÐ�sÓØ!Ð˜Ó!Ø&'Ð˜˜t™Ó'Ø€J�ÓØ#'Ð˜SÓ'Ø€L�%ÓØ48€O�^ dÑ*¨TÑ1Ó8Ø €N�DÓ Ø,/Ð�u˜s‘{ TÑ)Ó/Ø€HˆdÓØ#$Ð�c˜D‘jÓ$Ø'+Ð˜ ™Ó+Ø9<Ð(¨%°$©,Ó<Ø)*Ð˜C $™JÓ*Ø"#€O�S˜4‘ZÓ#Ø%'Ð˜˜d™
Ó'Ø"#€O�S˜4‘ZÓ#Ø(*Ð˜3 ™:Ó*Ø$%Ð�s˜T‘zÓ%Ø#Ð�uÓ#Ø#€L�#˜‘*Ó#Ø%€L�#˜‘*Ó%Ø+1€L�#˜˜S™	‘/ DÑ(Ó1Ø€IˆtÓØ %Ð˜Ó%Ø#€J��t‘Ó#Ø',Ð˜ ™Ó,÷(ð (r0   r3   N)r)   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   Ú
get_loggerr&   rP   r   r3   Ú__all__r/   r0   r1   ú<module>rd      s�   ðñ !å .å 3Ý 1ß ,ð 
ˆ×	Ñ	˜HÓ	%€ñ Ð8Ô9Øô&Ð#ó &ó ó :ð&ñD Ð8Ô9ØôP(Ð#ó P(ó ó :ðP(ðf Ð
�r0   