§
    9²¸jO  ã                   ó˜  — d Z ddlmZ ddlmZ ddlmZ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 ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Z ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Z ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Z ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Z ed¬¦  «        e G d„ de¦  «        ¦   «         ¦   «         ZdgZdS ) zESMFold2 model configuration.é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingé   )ÚCONFIG_MAPPINGÚ
AutoConfiga  
    Configuration for a sliding-window atom transformer with 3D RoPE.

    Used twice, with identical field names: once for the inputs embedder (`EsmFold2Config.atom_encoder`)
    and once for the diffusion denoiser (`EsmFold2Config.structure_head.diffusion_module.atom_encoder`).
    )Úcustom_introc                   óö   ‡ — e Zd ZU dZ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dz  ed<   ˆ fd„Zˆ fd„Zˆ xZS )ÚEsmFold2AtomEncoderConfiga  
    hidden_size (`int`, *optional*, defaults to 128):
        Per-atom hidden width of the atom transformer.
    output_dim (`int`, *optional*, defaults to 384):
        Width this stack aggregates to when scattering atoms back into tokens.
    num_hidden_layers (`int`, *optional*, defaults to 3):
        Number of sliding-window atom-transformer blocks.
    num_attention_heads (`int`, *optional*, defaults to 4):
        Number of attention heads in each atom-transformer block.
    head_dim (`int`, *optional*):
        Per-head width. Derived as `hidden_size // num_attention_heads` if unset.
    intermediate_size (`int`, *optional*, defaults to 256):
        SwiGLU feed-forward width.
    spatial_rope_base_frequency (`float`, *optional*, defaults to 20.0):
        Base frequency for the spatial (x/y/z) half of the 3D rotary embedding.
    num_spatial_rope_pairs_per_axis (`int`, *optional*, defaults to 2):
        Number of rotary frequency pairs allocated to each spatial axis.
    num_uid_rope_pairs (`int`, *optional*, defaults to 10):
        Number of rotary frequency pairs allocated to the per-atom space UID.
    uid_rope_base_frequency (`float`, *optional*, defaults to 10000.0):
        Base frequency for the space-UID half of the 3D rotary embedding.
    é€   NÚhidden_sizeé€  Ú
output_dimr   Únum_hidden_layersé   Únum_attention_headsÚhead_dimé   Úintermediate_sizeg      4@Úspatial_rope_base_frequencyr   Únum_spatial_rope_pairs_per_axisé
   Únum_uid_rope_pairsg     ˆÃ@Úuid_rope_base_frequencyc                 óp   •— | j         €| j        | j        z  | _          t          ¦   «         j        di |¤Ž d S ©N© )r   r   r   ÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úƒ/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/transformers/models/esmfold2/configuration_esmfold2.pyr!   z'EsmFold2AtomEncoderConfig.__post_init__F   s@   ø€ ØŒ=Ð Ø Ô,°Ô0HÑHˆDŒMØ�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c           	      óÔ   •— t          ¦   «                              ¦   «          d| j        z  | j        z   }|| j        dz  k    r&t          d|› d| j        dz  › d| j        › d�¦  «        ‚d S )Nr   r   zThe 3D rotary embedding needs z$ frequency pairs, which exceeds the z available in a head of width ú.)r    Úvalidate_architecturer   r   r   Ú
ValueError)r#   Únum_rope_pairsr%   s     €r&   r*   z/EsmFold2AtomEncoderConfig.validate_architectureK   s›   ø€ Ý‰Œ×%Ò%Ñ'Ô'Ð'à˜TÔAÑAÀDÔD[Ñ[ˆØ˜DœM¨QÑ.Ò.Ð.ÝðV°ð Vð VØ”= AÑ%ðVð VØEIÄ]ðVð Vð Vñô ð ð /Ð.r'   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   ÚintÚ__annotations__r   r   r   r   r   r   Úfloatr   r   r   r!   r*   Ú__classcell__©r%   s   @r&   r   r      s.  ø€ € € € € € ðð ð. "€K��t‘Ð!Ð!Ñ!Ø €J��d‘
Ð Ð Ñ Ø$%Ð�s˜T‘zÐ%Ð%Ñ%Ø&'Ð˜˜t™Ð'Ð'Ñ'Ø€Hˆc�D‰jÐÐÑØ$'Ð�s˜T‘zÐ'Ð'Ñ'Ø04Ð ¨¡Ð4Ð4Ñ4Ø23Ð# S¨4¡ZÐ3Ð3Ñ3Ø%'Ð˜˜d™
Ð'Ð'Ñ'Ø,3Ð˜U T™\Ð3Ð3Ñ3ð(ð (ð (ð (ð (ð
ð ð ð ð ð ð ð ð r'   r   zlConfiguration for the diffusion denoiser: an atom encoder/decoder around a token transformer with pair bias.c                   óð   ‡ — e Zd ZU dZdeiZ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z  dz  ed<   ˆ fd„Zˆ fd„Zˆ xZS )ÚEsmFold2DiffusionModuleConfiga¨  
    sigma_data (`float`, *optional*, defaults to 16.0):
        Data noise scale of the EDM preconditioning; sets the scale at which coordinates are normalized.
    hidden_size (`int`, *optional*, defaults to 768):
        Token-stream width of the diffusion transformer. Also the width the atom stack projects to and
        from, so `atom_encoder.output_dim` mirrors it.
    fourier_dim (`int`, *optional*, defaults to 256):
        Width of the Fourier noise-level embedding.
    num_hidden_layers (`int`, *optional*, defaults to 12):
        Number of token-transformer blocks (one attention + one transition each).
    num_attention_heads (`int`, *optional*, defaults to 16):
        Number of attention heads in the token transformer; also the width of each block's pair bias.
    head_dim (`int`, *optional*):
        Per-head width. Derived as `hidden_size // num_attention_heads` if unset.
    intermediate_size (`int`, *optional*, defaults to 1536):
        SwiGLU width of the token transitions, and of the conditioning's single transitions.
    pair_intermediate_size (`int`, *optional*, defaults to 512):
        SwiGLU width of the conditioning's pair transitions, which run at
        `EsmFold2Config.pairwise_hidden_size`.
    atom_encoder (`EsmFold2AtomEncoderConfig`, *optional*):
        Configuration for the denoiser's atom encoder/decoder stack; defaults to one whose `output_dim`
        is this module's `hidden_size`.
    Úatom_encoderg      0@NÚ
sigma_datai   r   r   Úfourier_dimé   r   é   r   r   i   r   é   Úpair_intermediate_sizec                 ó  •— | j         €| j        | j        z  | _         | j        €t	          | j        ¬¦  «        | _        n0t          | j        t          ¦  «        rt	          di | j        ¤Ž| _         t          ¦   «         j        di |¤Ž d S )N)r   r   )	r   r   r   r8   r   Ú
isinstanceÚdictr    r!   r"   s     €r&   r!   z+EsmFold2DiffusionModuleConfig.__post_init__€   s‘   ø€ ØŒ=Ð Ø Ô,°Ô0HÑHˆDŒMØÔÐ$Ý 9ÀTÔEUÐ VÑ VÔ VˆDÔÐÝ˜Ô)­4Ñ0Ô0ð 	OÝ 9Ð NÐ N¸DÔ<MÐ NÐ NˆDÔØ�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r'   c                 ó¼   •— t          ¦   «                              ¦   «          | j        j        | j        k    r%t          d| j        j        › d| j        › d�¦  «        ‚d S )NúThe atom_encoder.output_dim (z&) is not the token width hidden_size (z).)r    r*   r8   r   r   r+   )r#   r%   s    €r&   r*   z3EsmFold2DiffusionModuleConfig.validate_architecture‰   ss   ø€ Ý‰Œ×%Ò%Ñ'Ô'Ð'àÔÔ'¨4Ô+;Ò;Ð;Ýð5°Ô0AÔ0Lð 5ð 5Ø $Ô 0ð5ð 5ð 5ñô ð ð <Ð;r'   )r-   r.   r/   r0   r   Úsub_configsr9   r3   r2   r   r1   r:   r   r   r   r   r>   r8   rA   r!   r*   r4   r5   s   @r&   r7   r7   V   s)  ø€ € € € € € ðð ð0 "Ð#<Ð=€Kà#€J�˜‘Ð#Ð#Ñ#Ø!€K��t‘Ð!Ð!Ñ!Ø!€K��t‘Ð!Ð!Ñ!Ø$&Ð�s˜T‘zÐ&Ð&Ñ&Ø&(Ð˜˜t™Ð(Ð(Ñ(Ø€Hˆc�D‰jÐÐÑØ$(Ð�s˜T‘zÐ(Ð(Ñ(Ø),Ð˜C $™JÐ,Ð,Ñ,Ø<@€L�$Ð2Ñ2°TÑ9Ð@Ð@Ñ@ð(ð (ð (ð (ð (ðð ð ð ð ð ð ð ð r'   r7   zrConfiguration for the structure-prediction head: the distogram output plus the diffusion sampler's noise schedule.c                   ó"  ‡ — e Zd ZU dZdeiZ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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<   ˆ fd„Zˆ xZS )ÚEsmFold2StructureHeadConfigaå  
    diffusion_module (`EsmFold2DiffusionModuleConfig`, *optional*):
        Configuration for the denoiser this head samples from.
    num_distogram_bins (`int`, *optional*, defaults to 128):
        Number of distance bins predicted by the distogram head.
    num_diffusion_samples (`int`, *optional*, defaults to 8):
        Number of parallel structure samples drawn by the diffusion sampler.
    gamma_0 (`float`, *optional*, defaults to 0.605):
        Churn factor applied at noise levels above `gamma_min` (extra noise re-injected before a step).
    gamma_min (`float`, *optional*, defaults to 1.107):
        Noise level below which no churn is applied.
    noise_scale (`float`, *optional*, defaults to 0.0):
        Scale of the noise added by the churn step. `0.0` makes sampling a deterministic ODE.
    step_scale (`float`, *optional*, defaults to 1.0):
        Scale applied to each denoising update.
    inference_sigma_max_ratio (`float`, *optional*, defaults to 160.0):
        Highest sigma of the Karras noise schedule, as a multiple of `sigma_data` (so the default is a
        sigma of `160 * sigma_data`). Shapes the schedule; it is not where sampling starts, because
        `inference_sigma_cap` truncates the top of the schedule -- see there.
    inference_sigma_min_ratio (`float`, *optional*, defaults to 4e-4):
        Lowest sigma of the Karras noise schedule, likewise a multiple of `sigma_data`.
    inference_exponent (`float`, *optional*, defaults to 8.0):
        Exponent shaping the Karras schedule between `inference_sigma_min_ratio` and `inference_sigma_max_ratio`.
    inference_num_steps (`int`, *optional*, defaults to 68):
        Length of the Karras schedule built before truncation. Note this is not the number of denoising
        steps run: `inference_sigma_cap` drops the entries above the cap without lengthening the
        schedule to compensate, so the sampler runs fewer steps than this (with the released
        checkpoint's values, 14 becomes 10).
    inference_sigma_cap (`float`, *optional*, defaults to 256.0):
        Cap on the schedule, as an *absolute* sigma rather than a multiple of `sigma_data`. The
        high-sigma tail above it is truncated and the cap re-prepended, so sampling starts from the cap.
    Údiffusion_moduleNr   Únum_distogram_binsé   Únum_diffusion_samplesg\�Âõ(\ã?Úgamma_0gƒÀÊ¡E¶ñ?Ú	gamma_ming        Únoise_scaleg      ð?Ú
step_scaleg      d@Úinference_sigma_max_ratiog-Cëâ6:?Úinference_sigma_min_ratiog       @Úinference_exponentéD   Úinference_num_stepsg      p@Úinference_sigma_capc                 óÐ   •— | j         €t          ¦   «         | _         n0t          | j         t          ¦  «        rt          di | j         ¤Ž| _          t	          ¦   «         j        di |¤Ž d S r   )rG   r7   r@   rA   r    r!   r"   s     €r&   r!   z)EsmFold2StructureHeadConfig.__post_init__É   so   ø€ ØÔ Ð(Ý$AÑ$CÔ$CˆDÔ!Ð!Ý˜Ô-­tÑ4Ô4ð 	[Ý$AÐ$ZÐ$ZÀDÔDYÐ$ZÐ$ZˆDÔ!Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r'   )r-   r.   r/   r0   r7   rD   rG   rA   r2   rH   r1   rJ   rK   r3   rL   rM   rN   rO   rP   rQ   rS   rT   r!   r4   r5   s   @r&   rF   rF   “   sQ  ø€ € € € € € ðð ðB &Ð'DÐE€KàDHÐ�dÐ:Ñ:¸TÑAÐHÐHÑHØ%(Ð˜˜d™
Ð(Ð(Ñ(Ø()Ð˜3 ™:Ð)Ð)Ñ)Ø!€GˆU�T‰\Ð!Ð!Ñ!Ø#€Iˆu�t‰|Ð#Ð#Ñ#Ø #€K�˜‘Ð#Ð#Ñ#Ø"€J�˜‘Ð"Ð"Ñ"Ø.3Ð˜u t™|Ð3Ð3Ñ3Ø.2Ð˜u t™|Ð2Ð2Ñ2Ø'*Ð˜ ™Ð*Ð*Ñ*Ø&(Ð˜˜t™Ð(Ð(Ñ(Ø(-Ð˜ ™Ð-Ð-Ñ-ð(ð (ð (ð (ð (ð (ð (ð (ð (r'   rF   z|Configuration for the confidence head, which predicts pLDDT, PAE, PDE, resolved-atom probability and the pTM/ipTM summaries.c                   ó´   — e Zd ZU dZ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S )ÚEsmFold2ConfidenceHeadConfigu×  
    num_hidden_layers (`int`, *optional*, defaults to 4):
        Number of pair-update blocks in the head's own folding trunk.
    num_plddt_bins (`int`, *optional*, defaults to 50):
        Number of bins in the per-atom pLDDT distribution.
    num_pde_bins (`int`, *optional*, defaults to 64):
        Number of bins in the predicted-distance-error distribution.
    num_pae_bins (`int`, *optional*, defaults to 64):
        Number of bins in the predicted-aligned-error distribution.
    min_dist (`float`, *optional*, defaults to 2.0):
        Lower edge (Ã…) of the head's distance binning.
    max_dist (`float`, *optional*, defaults to 52.0):
        Upper edge (Ã…) of the head's distance binning.
    distogram_bins (`int`, *optional*, defaults to 128):
        Number of distance bins used to embed predicted inter-atom distances.
    eps (`float`, *optional*, defaults to 1e-6):
        Additive guard for masked-mean denominators (empty chains / all-padding rows).
    r   Nr   é2   Únum_plddt_binsé@   Únum_pde_binsÚnum_pae_binsg       @Úmin_distg      J@Úmax_distr   Údistogram_binsg�íµ ÷Æ°>Úeps)r-   r.   r/   r0   r   r1   r2   rY   r[   r\   r]   r3   r^   r_   r`   r   r'   r&   rW   rW   Ñ   s¿   € € € € € € ðð ð& %&Ð�s˜T‘zÐ%Ð%Ñ%Ø!#€N�C˜$‘JÐ#Ð#Ñ#Ø!€L�#˜‘*Ð!Ð!Ñ!Ø!€L�#˜‘*Ð!Ð!Ñ!Ø €Hˆe�d‰lÐ Ð Ñ Ø!€Hˆe�d‰lÐ!Ð!Ñ!Ø!$€N�C˜$‘JÐ$Ð$Ñ$Ø€Cˆ�‰ÐÐÑÐÐr'   rW   z—Configuration for the MSA encoder: outer-product-mean into the pair stream, pair-weighted averaging back into the MSA stream, and the triangle updates.c                   ó    — e Zd ZU dZ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S )ÚEsmFold2MsaEncoderConfigaò  
    hidden_size (`int`, *optional*, defaults to 128):
        Width of the MSA stream.
    outer_hidden_size (`int`, *optional*, defaults to 32):
        Per-side width of the outer-product-mean projection; the outer product is this value squared.
    num_hidden_layers (`int`, *optional*, defaults to 4):
        Number of MSA encoder blocks. The last one updates only the pair stream, since its MSA output
        would be discarded.
    num_attention_heads (`int`, *optional*, defaults to 8):
        Number of heads in the pair-weighted averaging.
    head_dim (`int`, *optional*, defaults to 32):
        Per-head width of the pair-weighted averaging.
    intermediate_size (`int`, *optional*, defaults to 512):
        SwiGLU width of the MSA-stream transition.
    outer_product_chunk_size (`int`, *optional*):
        Chunk size for the outer-product-mean einsum, off by default. Chunking this one is not always
        bit-exact in bf16, so it trades exactness for peak memory on long sequences.
    r   Nr   é    Úouter_hidden_sizer   r   rI   r   r   r=   r   Úouter_product_chunk_size)r-   r.   r/   r0   r   r1   r2   rd   r   r   r   r   re   r   r'   r&   rb   rb   ô   s¯   € € € € € € ðð ð& "€K��t‘Ð!Ð!Ñ!Ø$&Ð�s˜T‘zÐ&Ð&Ñ&Ø$%Ð�s˜T‘zÐ%Ð%Ñ%Ø&'Ð˜˜t™Ð'Ð'Ñ'Ø€Hˆc�D‰jÐÐÑØ$'Ð�s˜T‘zÐ'Ð'Ñ'Ø+/Ð˜c D™jÐ/Ð/Ñ/Ð/Ð/r'   rb   zWConfiguration for the language-model (ESMC) hidden-state encoder folded into the trunk.c                   óP   — e Zd ZU dZdZedz  ed<   dZedz  ed<   dZ	e
dz  ed<   dS )	ÚEsmFold2LmEncoderConfiga®  
    num_hidden_layers (`int`, *optional*, defaults to 4):
        Number of pair-update blocks refining the projected ESMC hidden states.
    lm_dropout (`float`, *optional*, defaults to 0.25):
        Dropout applied to the projected language-model pair representation.
    per_loop_lm_dropout (`bool`, *optional*, defaults to `True`):
        Whether to resample that dropout on every trunk loop rather than once per fold.
    r   Nr   g      Ð?Ú
lm_dropoutTÚper_loop_lm_dropout)r-   r.   r/   r0   r   r1   r2   rh   r3   ri   Úboolr   r'   r&   rg   rg     s\   € € € € € € ðð ð %&Ð�s˜T‘zÐ%Ð%Ñ%Ø#€J�˜‘Ð#Ð#Ñ#Ø'+Ð˜ ™Ð+Ð+Ñ+Ð+Ð+r'   rg   zbiohub/ESMFold2-hf)Ú
checkpointc                   ó4  ‡ — e Zd ZU dZdZeeeee	e
dœZ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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z  dz  ed#<   dZ!e ez  dz  ed$<   dZ"e ez  dz  ed%<   dZ#e e	z  dz  ed&<   dZ$e e
z  dz  ed'<   dZ%e e&z  dz  ed(<   ˆ fd)„Z'ˆ fd*„Z(ˆ xZ)S )+ÚEsmFold2ConfigaÚ  
    hidden_size (`int`, *optional*, defaults to 384):
        Single-representation width.
    pairwise_hidden_size (`int`, *optional*, defaults to 256):
        Pair-representation width.
    single_inputs_size (`int`, *optional*, defaults to 451):
        Width of the concatenated single-input features fed to the trunk and diffusion conditioning:
        `atom_encoder.output_dim` plus two residue-type one-hots and the profile scalar.
    pair_transition_intermediate_size (`int`, *optional*, defaults to 1024):
        SwiGLU width of the pair-stream transitions.
    sliding_window (`int`, *optional*, defaults to 128):
        Sliding-window size (token-index distance) for the atom-stack attention, as the total window
        width rather than the radius.
    chunk_size (`int`, *optional*, defaults to 64):
        Chunk size for the memory-heavy pair-/MSA-stream ops. `None` disables chunking.
    num_relative_residx_bins (`int`, *optional*, defaults to 32):
        Number of relative residue-index bins in the relative-position encoding.
    num_relative_chain_bins (`int`, *optional*, defaults to 2):
        Number of relative chain-index bins in the relative-position encoding.
    num_loops (`int`, *optional*, defaults to 10):
        Number of trunk refinement loops.
    num_res_types (`int`, *optional*, defaults to 33):
        Number of residue types.
    max_atomic_number (`int`, *optional*, defaults to 128):
        Size of the element one-hot in the atom features.
    char_vocab_size (`int`, *optional*, defaults to 64):
        Character-vocabulary size for the encoded atom names.
    max_chars (`int`, *optional*, defaults to 4):
        Number of characters per encoded atom name.
    max_atoms_per_token (`int`, *optional*, defaults to 23):
        Maximum number of atoms per token.
    atom_feature_dim (`int`, *optional*):
        Atom feature width: xyz, charge and mask, plus the element and atom-name-char one-hots. Derived
        from `max_atomic_number`, `char_vocab_size` and `max_chars` if unset.
    folding_trunk_num_hidden_layers (`int`, *optional*, defaults to 24):
        Number of pair-update blocks in the folding trunk.
    parcae_num_coda_layers (`int`, *optional*, defaults to 2):
        Number of pair-update blocks in the parcae coda.
    atom_encoder (`EsmFold2AtomEncoderConfig`, *optional*):
        Configuration for the inputs-embedder SWA atom encoder.
    structure_head (`EsmFold2StructureHeadConfig`, *optional*):
        Configuration for the diffusion structure-prediction head (holds the `diffusion_module` sub-config).
    confidence_head (`EsmFold2ConfidenceHeadConfig`, *optional*):
        Configuration for the confidence head.
    msa_encoder (`EsmFold2MsaEncoderConfig`, *optional*):
        Configuration for the MSA encoder.
    lm_encoder (`EsmFold2LmEncoderConfig`, *optional*):
        Configuration for the language-model hidden-state encoder.
    esmc_config ([`EsmcConfig`], *optional*):
        Configuration for the bundled ESMC backbone.
    Úesmfold2)Úesmc_configr8   Ústructure_headÚconfidence_headÚmsa_encoderÚ
lm_encoderr   Nr   r   Úpairwise_hidden_sizeiÃ  Úsingle_inputs_sizei   Ú!pair_transition_intermediate_sizer   Úsliding_windowrZ   Ú
chunk_sizerc   Únum_relative_residx_binsr   Únum_relative_chain_binsr   Ú	num_loopsé!   Únum_res_typesÚmax_atomic_numberÚchar_vocab_sizer   Ú	max_charsé   Úmax_atoms_per_tokenÚatom_feature_dimé   Úfolding_trunk_num_hidden_layersÚparcae_num_coda_layersr8   rp   rq   rr   rs   ro   c                 óÜ  •— d„ } |t           d         | j        ¦  «        | _         |t          | j        ¦  «        | _         |t          | j        ¦  «        | _         |t          | j        ¦  «        | _         |t          | j	        ¦  «        | _	         |t          | j        ¦  «        | _        | j        €d| j        z   | j        | j        z  z   | _         t!          ¦   «         j        di |¤Ž d S )Nc                 óX   — |€
 | ¦   «         S t          |t          ¦  «        r | di |¤ŽS |S r   )r@   rA   )ÚclsÚvals     r&   Ú_init_nestedz2EsmFold2Config.__post_init__.<locals>._init_nested‚  s;   € Øˆ{Ø�s‘u”u�Ý˜#�tÑ$Ô$ð "Ø�s�z�z˜S�z�zÐ!ØˆJr'   Úesmcé   r   )r	   ro   r   r8   rF   rp   rW   rq   rb   rr   rg   rs   rƒ   r~   r   r€   r    r!   )r#   r$   r‹   r%   s      €r&   r!   zEsmFold2Config.__post_init__�  sõ   ø€ ð	ð 	ð 	ð (˜<­°vÔ(>ÀÔ@PÑQÔQˆÔØ(˜LÕ)BÀDÔDUÑVÔVˆÔØ*˜lÕ+FÈÔH[Ñ\Ô\ˆÔØ+˜|Õ,HÈ$ÔJ^Ñ_Ô_ˆÔØ'˜<Õ(@À$ÔBRÑSÔSˆÔØ&˜,Õ'>ÀÄÑPÔPˆŒð Ô Ð(Ø$-°Ô0FÑ$FÈÔI]Ð`dÔ`nÑInÑ$nˆDÔ!à�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r'   c           	      óâ   •— t          ¦   «                              ¦   «          | j        d| j        z  dz   z
  }| j        j        |k    r(t          d| j        j        › d| j        › d|› d�¦  «        ‚dS )zQChecks the width relations that span sub-configs; each sub-config checks its own.r   é   rC   z) is not single_inputs_size (z) - (2 * num_res_types + 1) = r)   N)r    r*   ru   r}   r8   r   r+   )r#   Úexpected_output_dimr%   s     €r&   r*   z$EsmFold2Config.validate_architecture–  s¤   ø€ å‰Œ×%Ò%Ñ'Ô'Ð'ð #Ô5¸¸TÔ=OÑ9OÐRSÑ9SÑTÐØÔÔ'Ð+>Ò>Ð>Ýðb°Ô0AÔ0Lð bð bØÔ+ðbð bØK^ðbð bð bñô ð ð ?Ð>r'   )*r-   r.   r/   r0   Ú
model_typer
   r   rF   rW   rb   rg   rD   r   r1   r2   rt   ru   rv   rw   rx   ry   rz   r{   r}   r~   r   r€   r‚   rƒ   r…   r†   r8   rA   rp   rq   rr   rs   ro   r   r!   r*   r4   r5   s   @r&   rm   rm   '  s…  ø€ € € € € € ð2ð 2ðh €Jà!Ø1Ø5Ø7Ø/Ø-ðð €Kð "€K��t‘Ð!Ð!Ñ!Ø'*Ð˜# ™*Ð*Ð*Ñ*Ø%(Ð˜˜d™
Ð(Ð(Ñ(Ø48Ð% s¨T¡zÐ8Ð8Ñ8Ø!$€N�C˜$‘JÐ$Ð$Ñ$Ø€J��d‘
ÐÐÑØ+-Ð˜c D™jÐ-Ð-Ñ-Ø*+Ð˜S 4™ZÐ+Ð+Ñ+Ø€Iˆs�T‰zÐÐÑØ "€M�3˜‘:Ð"Ð"Ñ"Ø$'Ð�s˜T‘zÐ'Ð'Ñ'Ø"$€O�S˜4‘ZÐ$Ð$Ñ$Ø€Iˆs�T‰zÐÐÑØ&(Ð˜˜t™Ð(Ð(Ñ(Ø#'Ð�c˜D‘jÐ'Ð'Ñ'Ø24Ð# S¨4¡ZÐ4Ð4Ñ4Ø)*Ð˜C $™JÐ*Ð*Ñ*à<@€L�$Ð2Ñ2°TÑ9Ð@Ð@Ñ@Ø@D€N�DÐ6Ñ6¸Ñ=ÐDÐDÑDØBF€O�TÐ8Ñ8¸4Ñ?ÐFÐFÑFØ:>€K�Ð0Ñ0°4Ñ7Ð>Ð>Ñ>Ø8<€J�Ð.Ñ.°Ñ5Ð<Ð<Ñ<Ø26€K�Ð(Ñ(¨4Ñ/Ð6Ð6Ñ6ð(ð (ð (ð (ð (ð*
ð 
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r'   rm   N)r0   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Úautor	   r
   Ú
get_loggerr-   Úloggerr   r7   rF   rW   rb   rg   rm   Ú__all__r   r'   r&   ú<module>r™      sý  ðð $Ð #à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð 
ˆÔ	˜HÑ	%Ô	%€ð €ððñ ô ð ð0ð 0ð 0ð 0ð 0Ð 0ñ 0ô 0ñ „ñô ð0ðf €ð"ðñ ô ð ð5ð 5ð 5ð 5ð 5Ð$4ñ 5ô 5ñ „ñ	ô ð
5ðp €ð*ðñ ô ð ð6(ð 6(ð 6(ð 6(ð 6(Ð"2ñ 6(ô 6(ñ „ñ	ô ð
6(ðr €ð.ðñ ô ð ðð ð ð ð Ð#3ñ ô ñ „ñ	ô ð
ð< €ðRðñ ô ð ð0ð 0ð 0ð 0ð 0Ð/ñ 0ô 0ñ „ñ	ô ð
0ð: €ÐvÐwÑwÔwØð,ð ,ð ,ð ,ð ,Ð.ñ ,ô ,ñ „ñ xÔwð,ð €Ð/Ð0Ñ0Ô0Øðwð wð wð wð wÐ%ñ wô wñ „ñ 1Ô0ðwðt Ð
€€€r'   