
    ^j-                        d 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 ed      e G d de                    Zg dZy)zKOSMOS-2 model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzmicrosoft/kosmos-2-patch14-224)
checkpointc                   v   e Zd ZU dZdZdgZddd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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d!z  e	d"<   d#Zed!z  e	d$<   d%Zeee   z  d!z  e	d&<   d'Z ee	d(<   y!))Kosmos2TextConfigkosmos_2_text_modeltext_configpast_key_valuesattention_heads	embed_dimlayers)num_attention_headshidden_sizenum_hidden_layersi  
vocab_sizei   max_position_embeddings   i    ffn_dim    geluactivation_functiong?dropoutattention_dropout        activation_dropout	layerdroph㈵>layer_norm_eps{Gz?init_stdTscale_embedding	use_cachetie_word_embeddings   Npad_token_idr   bos_token_id   eos_token_idFadd_cross_attention)!__name__
__module____qualname__
model_typebase_config_keykeys_to_ignore_at_inferenceattribute_mapr   int__annotations__r   r   r   r   r   r   strr   floatr   r   r   r!   r#   r$   boolr%   r&   r(   r)   r+   listr,        |/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/kosmos2/configuration_kosmos2.pyr
   r
      s    'J#O#4"50"%M J#'S'IsFCGSOS%%GUS[%(us{(&)) Ius{  NE He OT It $$ L#*  L#* +,L#S	/D(, %%r;   r
   c                       e Zd ZU dZ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e   z  eeef   z  ed<   dZeee   z  eeef   z  ed<   dZeed<   dZeed<   dZeez  ed<   dZeed<   dZeed<   y)Kosmos2VisionConfigkosmos_2_vision_modelvision_configi   r   i   intermediate_sizer   r      r   r   num_channels   
image_size   
patch_size
quick_gelu
hidden_actr    r!   r   r   r"   initializer_rangeg      ?initializer_factorN)r-   r.   r/   r0   r1   r   r4   r5   rA   r   r   rC   rE   r9   tuplerG   rI   r6   r!   r7   r   rJ   rK   r:   r;   r<   r>   r>   ;   s     )J%OK!s!s!!L#47Jd3i%S/1746Jd3i%S/16"J" NE %(us{(#u# ##r;   r>   c                        e Zd ZU dZdZeedZdZe	e
z  dz  ed<   dZe	e
z  dz  ed<   dZeed<   d	Zeed
<    fdZ xZS )Kosmos2Configaf  
    latent_query_num (`int`, *optional*, defaults to 64):
        The number of latent query tokens that represent the image features used in the text decoder component.

    Example:

    ```python
    >>> from transformers import Kosmos2Config, Kosmos2Model

    >>> # Initializing a Kosmos-2 kosmos-2-patch14-224 style configuration
    >>> configuration = Kosmos2Config()

    >>> # Initializing a model (with random weights) from the kosmos-2-patch14-224 style configuration
    >>> model = Kosmos2Model(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```zkosmos-2)r   r@   Nr   r@   @   latent_query_numTr&   c                    | j                   %t               | _         t        j                  d       n4t	        | j                   t
              rt        di | j                   | _         | j                  %t               | _        t        j                  d       n4t	        | j                  t
              rt        di | j                  | _        t        | $  di | y )NzR`text_config` is `None`. initializing the `Kosmos2TextConfig` with default values.zV`vision_config` is `None`. initializing the `Kosmos2VisionConfig` with default values.r:   )
r   r
   loggerinfo
isinstancedictr@   r>   super__post_init__)selfkwargs	__class__s     r<   rW   zKosmos2Config.__post_init__m   s    #02DKKlm(($/0D43C3CDD%!4!6DKKpq**D1!4!Jt7I7I!JD''r;   )r-   r.   r/   __doc__r0   r
   r>   sub_configsr   rU   r   r5   r@   rP   r4   r&   r8   rW   __classcell__)rZ   s   @r<   rN   rN   O   sd    & J"3FYZK26K((4/648M4**T18c $$( (r;   rN   )rN   r
   r>   N)r[   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr-   rR   r
   r>   rN   __all__r:   r;   r<   <module>rc      s    # . 3 , 
		H	% ;<&( &  =&@ ;<$* $  =$$ ;<)($ )(  =)(X Hr;   