
    i                         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 <   y!)"SaProtConfigat  
    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.
    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{Gz?initializer_rangeh㈵>layer_norm_epsrotaryposition_embedding_typeF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!   boolr"   r#   r$        /var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/evolla/configuration_evolla.pyr   r      s    	 JM3L#Ks!!!s!'**03 %#+3#'S'#u#!NE!#+S+"'4'M4J %%r/   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
    ```EvollaModel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.   )r4   r   loggerinfo
isinstancedictsuper__post_init__)selfkwargs	__class__s     r0   rT   zEvollaConfig.__post_init__   s\    &&.*6.D'KKrs33T:*6*U9T9T*UD'''r/   )2r%   r&   r'   r(   
model_typer   sub_configsdefault_thetar4   rR   r   r*   r   r)   r   r   r   r   r7   r9   r,   r   r:   r+   r;   r   r<   r-   r=   r>   r?   r@   rA   rB   rD   rF   rG   rH   rI   r   r   rJ   rK   listrL   rM   r#   r$   rT   __classcell__)rW   s   @r0   r2   r2   ;   s   #J J+\:KM=AD#33d:AJK"s"s!!&'t'J#'S'L%48O^d*T18 ND ,/us{T)/Hd#$cDj$'++9<(%$,<)*C$J*"#OS4Z#%'d
'"#OS4Z#(*3:*$%sTz%#u##L#*#%L#*%+1L#S	/D(1It %%#Jt#',,( (r/   r2   N)r(   huggingface_hub.dataclassesr   configuration_utilsr   modeling_rope_utilsr   utilsr   r   
get_loggerr%   rO   r   r2   __all__r.   r/   r0   <module>rc      s    ! . 3 1 , 
		H	% 89&# &  :&> 89P(# P(  :P(f 
r/   