Ë
    S^(h…  ã                   óÊ   — d Z ddlmZmZ ddlmZ ddlmZ  ej                  e	«      Z
 G d„ de«      Z G d„ d	e«      Z G d
„ de«      Z G d„ de«      Z G d„ de«      Zg d¢Zy)zFLAVA model configurationsé    )ÚAnyÚDicté   )ÚPretrainedConfig)Úloggingc                   óˆ   ‡ — e Zd ZdZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddededededed	ed
ededededededededefˆ fd„Z	ˆ xZ
S )ÚFlavaImageConfigaí  
    This is the configuration class to store the configuration of a [`FlavaImageModel`]. It is used to instantiate an
    FLAVA model according to the specified arguments, defining the model architecture.

    Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
    [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.


    Args:
        hidden_size (`int`, *optional*, defaults to 768):
            Dimensionality of the encoder layers and the pooler layer.
        num_hidden_layers (`int`, *optional*, defaults to 12):
            Number of hidden layers in the Transformer encoder.
        num_attention_heads (`int`, *optional*, defaults to 12):
            Number of attention heads for each attention layer in the Transformer encoder.
        intermediate_size (`int`, *optional*, defaults to 3072):
            Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        hidden_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        attention_probs_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        layer_norm_eps (`float`, *optional*, defaults to 1e-12):
            The epsilon used by the layer normalization layers.
        image_size (`int`, *optional*, defaults to 224):
            The size (resolution) of each image.
        patch_size (`int`, *optional*, defaults to 16):
            The size (resolution) of each patch.
        num_channels (`int`, *optional*, defaults to 3):
            The number of input channels.
        qkv_bias (`bool`, *optional*, defaults to `True`):
            Whether to add a bias to the queries, keys and values.
        mask_token (`bool`, *optional*, defaults to `True`):
            Whether to use a mask token or not. Used in MIM (Masked Image Modeling) loss for FLAVA.
        vocab_size (`int`, *optional*, defaults to 8192):
            Vocabulary size of the [`FlavaImageCodebook`] used in conjunction with [`FlavaImageModel`] for MIM (Masked
            Image Modeling) loss for FLAVA.

    Example:

    ```python
    >>> from transformers import FlavaImageConfig, FlavaImageModel

    >>> # Initializing a FlavaImageModel with  style configuration
    >>> configuration = FlavaImageConfig()

    >>> # Initializing a FlavaImageModel model (with random weights) from the style configuration
    >>> model = FlavaImageModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úflava_image_modelÚimage_configÚhidden_sizeÚnum_hidden_layersÚnum_attention_headsÚintermediate_sizeÚ
hidden_actÚhidden_dropout_probÚattention_probs_dropout_probÚinitializer_rangeÚlayer_norm_epsÚ
image_sizeÚ
patch_sizeÚnum_channelsÚqkv_biasÚ
mask_tokenÚ
vocab_sizec                 óö   •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        y ©N© )ÚsuperÚ__init__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )Úselfr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ÚkwargsÚ	__class__s                    €úk/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/transformers/models/flava/configuration_flava.pyr   zFlavaImageConfig.__init__Z   s‡   ø€ ô& 	‰ÑÑ"˜6Ò"à&ˆÔØ!2ˆÔØ#6ˆÔ Ø!2ˆÔØ$ˆŒØ#6ˆÔ Ø,HˆÔ)Ø!2ˆÔØ,ˆÔØ$ˆŒØ$ˆŒØ(ˆÔØ ˆŒØ$ˆŒØ$ˆ�ó    )é   é   r&   é   Úgeluç        r)   ç{®Gáz”?çê-�™—q=éà   é   r   TTé    ©Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyÚintÚfloatÚboolr   Ú__classcell__©r"   s   @r#   r	   r	      sâ   ø„ ñ:ðx %€JØ$€Oð Ø!#Ø#%Ø!%Ø Ø%(Ø.1Ø#'Ø %ØØØØØØñ!#%àð#%ð ð#%ð !ð	#%ð
 ð#%ð ð#%ð #ð#%ð ',ð#%ð !ð#%ð ð#%ð ð#%ð ð#%ð ð#%ð ð#%ð ð#%ð  ÷!#%ñ #%r$   r	   c                   óˆ   ‡ — e Zd ZdZdZdZ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ddededededed	ed
edededededededede	fˆ fd„Z
ˆ xZS )ÚFlavaTextConfigaC  
    This is the configuration class to store the configuration of a [`FlavaTextModel`]. It is used to instantiate an
    FLAVA model according to the specified arguments, defining the model architecture.

    Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
    [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.


    Args:
        vocab_size (`int`, *optional*, defaults to 30522):
            Vocabulary size of the BERT model. Defines the number of different tokens that can be represented by the
            `inputs_ids` passed when calling [`FlavaTextModel`].
        type_vocab_size (`int`, *optional*, defaults to 2):
            The vocabulary size of the `token_type_ids` passed when calling [`FlavaTextModel`]. Note that even though
            text encoder allows `token_type_ids`'s value as 2, for text-only pretraining and fine-tuning, only 1 is
            used similar to RoBERTa.
        max_position_embeddings (`int`, *optional*, defaults to 512):
            The maximum sequence length that this model might ever be used with. Typically set this to something large
            just in case (e.g., 512 or 1024 or 2048). For VL, max_length passed to model is 77.
        position_embedding_type (`str`, *optional*, defaults to `"absolute"`):
            Type of position embedding. Choose one of `"absolute"`, `"relative_key"`, `"relative_key_query"`. For
            positional embeddings use `"absolute"`. For more information on `"relative_key"`, please refer to
            [Self-Attention with Relative Position Representations (Shaw et al.)](https://arxiv.org/abs/1803.02155).
            For more information on `"relative_key_query"`, please refer to *Method 4* in [Improve Transformer Models
            with Better Relative Position Embeddings (Huang et al.)](https://arxiv.org/abs/2009.13658).
        hidden_size (`int`, *optional*, defaults to 768):
            Dimensionality of the encoder layers and the pooler layer.
        num_hidden_layers (`int`, *optional*, defaults to 12):
            Number of hidden layers in the Transformer encoder.
        num_attention_heads (`int`, *optional*, defaults to 12):
            Number of attention heads for each attention layer in the Transformer encoder.
        intermediate_size (`int`, *optional*, defaults to 3072):
            Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        hidden_dropout_prob (`float`, *optional*, defaults to 0.1):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        attention_probs_dropout_prob (`float`, *optional*, defaults to 0.1):
            The dropout ratio for the attention probabilities.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        layer_norm_eps (`float`, *optional*, defaults to 1e-12):
            The epsilon used by the layer normalization layers.
        image_size (`int`, *optional*, defaults to 224):
            The size (resolution) of each image.
        patch_size (`int`, *optional*, defaults to 16):
            The size (resolution) of each patch.
        num_channels (`int`, *optional*, defaults to 3):
            The number of input channels.
        qkv_bias (`bool`, *optional*, defaults to `True`):
            Whether to add a bias to the queries, keys and values.

    Example:

    ```python
    >>> from transformers import FlavaTextConfig, FlavaTextModel

    >>> # Initializing a FlavaTextModel with  style configuration
    >>> configuration = FlavaTextConfig()

    >>> # Initializing a FlavaTextModel model (with random weights) from the style configuration
    >>> model = FlavaTextModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úflava_text_modelÚtext_configr   Útype_vocab_sizeÚmax_position_embeddingsÚposition_embedding_typer   r   r   r   r   r   r   r   r   Úpad_token_idr   c                 óö   •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        || _        || _        || _        || _        y r   )r   r   r   r?   r@   rA   r   r   r   r   r   r   r   r   r   r   rB   )r    r   r?   r@   rA   r   r   r   r   r   r   r   r   r   rB   r   r!   r"   s                    €r#   r   zFlavaTextConfig.__init__Ë   sŠ   ø€ ô& 	‰ÑÑ"˜6Ò"à$ˆŒØ.ˆÔØ'>ˆÔ$Ø'>ˆÔ$Ø&ˆÔØ!2ˆÔØ#6ˆÔ Ø!2ˆÔØ$ˆŒØ#6ˆÔ Ø,HˆÔ)Ø!2ˆÔØ,ˆÔØ ˆŒØ(ˆÕr$   )i:w  é   i   Úabsoluter%   r&   r&   r'   r(   r)   r)   r*   r+   r   T)r0   r1   r2   r3   r4   r5   r6   Ústrr7   r8   r   r9   r:   s   @r#   r<   r<   €   sã   ø„ ñEðN $€JØ#€Oð  Ø Ø'*Ø'1ØØ!#Ø#%Ø!%Ø Ø%(Ø.1Ø#'Ø %ØØñ!#)àð#)ð ð#)ð "%ð	#)ð
 "%ð#)ð ð#)ð ð#)ð !ð#)ð ð#)ð ð#)ð #ð#)ð ',ð#)ð !ð#)ð ð#)ð ð#)ð  ÷!#)ñ #)r$   r<   c                   óp   ‡ — e Zd ZdZdZdZ	 	 	 	 	 	 	 	 	 	 	 ddededededed	ed
ededededefˆ fd„Z	ˆ xZ
S )ÚFlavaMultimodalConfiga  
    This is the configuration class to store the configuration of a [`FlavaMultimodalModel`]. It is used to instantiate
    an FLAVA model according to the specified arguments, defining the model architecture.

    Instantiating a configuration with the defaults will yield a similar configuration to that of the FLAVA
    [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.


    Args:
        hidden_size (`int`, *optional*, defaults to 768):
            Dimensionality of the encoder layers and the pooler layer.
        num_hidden_layers (`int`, *optional*, defaults to 6):
            Number of hidden layers in the Transformer encoder.
        num_attention_heads (`int`, *optional*, defaults to 12):
            Number of attention heads for each attention layer in the Transformer encoder.
        intermediate_size (`int`, *optional*, defaults to 3072):
            Dimensionality of the "intermediate" (i.e., feed-forward) layer in the Transformer encoder.
        hidden_act (`str` or `function`, *optional*, defaults to `"gelu"`):
            The non-linear activation function (function or string) in the encoder and pooler. If string, `"gelu"`,
            `"relu"`, `"selu"` and `"gelu_new"` are supported.
        hidden_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
        attention_probs_dropout_prob (`float`, *optional*, defaults to 0.0):
            The dropout ratio for the attention probabilities.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        layer_norm_eps (`float`, *optional*, defaults to 1e-12):
            The epsilon used by the layer normalization layers.
        qkv_bias (`bool`, *optional*, defaults to `True`):
            Whether to add a bias to the queries, keys and values.
        use_cls_token (`bool`, *optional*, defaults to `True`):
            Whether to use an extra CLS token for multimodal settings. Usually needed by the FLAVA model.


    Example:

    ```python
    >>> from transformers import FlavaMultimodalConfig, FlavaMultimodalModel

    >>> # Initializing a FlavaMultimodalModel with  style configuration
    >>> configuration = FlavaMultimodalConfig()

    >>> # Initializing a FlavaMultimodalModel model (with random weights) from the style configuration
    >>> model = FlavaMultimodalModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úflava_multimodal_modelÚmultimodal_configr   r   r   r   r   r   r   r   r   r   Úuse_cls_tokenc                 ó¾   •— t        ‰| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        || _	        |	| _
        |
| _        || _        y r   )r   r   r   r   r   r   r   r   r   r   r   r   rK   )r    r   r   r   r   r   r   r   r   r   r   rK   r!   r"   s                €r#   r   zFlavaMultimodalConfig.__init__)  sk   ø€ ô 	‰ÑÑ"˜6Ò"à&ˆÔØ!2ˆÔØ#6ˆÔ Ø!2ˆÔØ$ˆŒØ#6ˆÔ Ø,HˆÔ)Ø!2ˆÔØ,ˆÔØ ˆŒØ*ˆÕr$   )r%   é   r&   r'   r(   r)   r)   r*   r+   TTr/   r:   s   @r#   rH   rH   ñ   s®   ø„ ñ2ðh *€JØ)€Oð Ø!"Ø#%Ø!%Ø Ø#&Ø,/Ø#'Ø %ØØ"ñ+àð+ð ð+ð !ð	+ð
 ð+ð ð+ð !ð+ð '*ð+ð !ð+ð ð+ð ð+ð ÷+ñ +r$   rH   c                   óV   ‡ — e Zd ZdZdZ	 	 	 	 	 	 	 	 ddedededededed	efˆ fd
„Zˆ xZS )ÚFlavaImageCodebookConfigÚflava_image_codebookÚimage_codebook_configÚ
num_groupsÚinput_channelsÚnum_blocks_per_groupr   r   Úfreezer   c                 ó†   •— t        ‰	| �  di |¤Ž || _        || _        || _        || _        || _        || _        || _        y r   )	r   r   rR   rS   rT   r   r   rU   r   )
r    rR   rS   rT   r   r   rU   r   r!   r"   s
            €r#   r   z!FlavaImageCodebookConfig.__init__v  sJ   ø€ ô 	‰ÑÑ"˜6Ò"Ø$ˆŒØ,ˆÔØ$8ˆÔ!Ø&ˆÔØ$ˆŒØˆŒØ!2ˆÕr$   )é   r   rD   é   r.   Tr*   )	r0   r1   r2   r4   r5   r6   r7   r   r9   r:   s   @r#   rO   rO   G  sx   ø„ Ø'€JØ-€Oð)ðZ ØØ$%ØØØØ#'ñ3àð3ð ð3ð "ð	3ð
 ð3ð ð3ð ð3ð !÷3ñ 3r$   rO   c            )       óú   ‡ — e Zd ZdZdZeeeedœZ		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dde
eef   de
eef   de
eef   de
eef   ded	ed
edededededededededededededef(ˆ fd„Zededededefd„«       Zˆ xZS )ÚFlavaConfigaü  
    [`FlavaConfig`] is the configuration class to store the configuration of a [`FlavaModel`]. It is used to
    instantiate FLAVA model according to the specified arguments, defining the text model, image model, image codebook
    and multimodal model configs. Instantiating a configuration with the defaults will yield a similar configuration to
    that of the FLAVA [facebook/flava-full](https://huggingface.co/facebook/flava-full) architecture.

    Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the
    documentation from [`PretrainedConfig`] for more information.

    Args:
        text_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize [`FlavaTextConfig`].
        image_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize [`FlavaImageConfig`].
        multimodal_config (`dict`, *optional*):
            Dictionary of configuration options used to initialize [`FlavaMultimodalConfig`].
        hidden_size (`int`, *optional*, defaults to 768):
            Dimensionality of the encoder layers and the pooler layer.
        layer_norm_eps (`float`, *optional*, defaults to 1e-12):
            The epsilon used by the layer normalization layers.
        projection_dim (`int`, *optional*, defaults to 512):
            Dimensionality of text and image projection layers.
        logit_scale_init_value (`float`, *optional*, defaults to 2.6592):
            The initial value of the *logit_scale* parameter. Default is used as per the original FLAVA/CLIP
            implementation.
        initializer_range (`float`, *optional*, defaults to 0.02):
            The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
        ce_ignore_index (`int`, *optional*, defaults to -100):
            Cross entropy index to ignore.
        mim_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to MIM (Masked Image Modeling) unimodal loss
        mlm_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to MLM (Masked Language Modeling) unimodal loss
        global_contrastive_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to global contrastive cross-alignment loss.
        itm_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to image-text matching multimodal loss.
        mmm_image_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to MMM loss's image part.
        mmm_text_weight (`float`, *optional*, defaults to 1.0):
            Weight to be assigned to MMM loss's text part.
        global_backprop_contrastive (`bool`, *optional*, defaults to `True`):
            Whether to use global backpropgation through all workers in contrastive loss.
        skip_unmasked_multimodal_encoder (`bool`, *optional*, defaults to `True`):
            Whether to skip running unmasked multimodal encoder whose outputs are not used by FLAVA losses.
        return_loss (`bool`, *optional*, defaults to `True`):
            Whether to return loss or not

        kwargs (*optional*):
            Dictionary of keyword arguments.

    Example:

    ```python
    >>> from transformers import FlavaConfig, FlavaModel, FlavaForPreTraining

    >>> # Initializing a FlavaConfig with style configuration
    >>> configuration = FlavaConfig()

    >>> # Initializing a FlavaModel and FlavaForPreTraining model (with random weights) from the style configuration
    >>> model = FlavaModel(configuration)
    >>> model_pre = FlavaForPreTraining(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    >>> configuration_pre = model_pre.config
    ```
    Úflava)r>   r   rJ   rQ   r   r>   rJ   rQ   r   r   Úprojection_dimÚinit_codebookÚlogit_scale_init_valuer   Úce_ignore_indexÚ
mim_weightÚ
mlm_weightÚglobal_contrastive_weightÚ
itm_weightÚmmm_image_weightÚmmm_text_weightÚglobal_backprop_contrastiveÚ skip_unmasked_multimodal_encoderÚreturn_lossc                 ó„  •— |j                  dd «      }|j                  dd «      }|j                  dd «      }|j                  dd «      }t        ‰!| �  di |¤Ž |�‚|€i }t        di |¤Žj	                  «       }|j                  «       D ]A  \  }}||v sŒ|||   k7  sŒ|dvsŒ||v r
d|› d|› d�}nd	|› d
�}t        j                  |«       ŒC |j                  |«       |�¹|€i }t        di |¤Žj	                  «       }d|v r3|d   j                  «       D ��ci c]  \  }}t        |«      |“Œ c}}|d<   |j                  «       D ]A  \  }}||v sŒ|||   k7  sŒ|dvsŒ||v r
d|› d|› d�}nd|› d
�}t        j                  |«       ŒC |j                  |«       |�‚|€i }t        di |¤Žj	                  «       }|j                  «       D ]A  \  }}||v sŒ|||   k7  sŒ|dvsŒ||v r
d|› d|› d�}nd|› d
�}t        j                  |«       ŒC |j                  |«       |�‚|€i }t        di |¤Žj	                  «       } | j                  «       D ]A  \  }}||v sŒ|||   k7  sŒ|dvsŒ||v r
d|› d|› d�}nd|› d
�}t        j                  |«       ŒC |j                  | «       |€i }t        j                  d«       |€i }t        j                  d«       |€i }t        j                  d«       |€i }t        j                  d«       t        di |¤Ž| _        t        di |¤Ž| _        t        di |¤Ž| _        t        di |¤Ž| _        || _        || _        || _        || _        |
| _        |	| _        d| _        || _        || _        || _        || _        || _        || _        || _        || _        || _         || _!        y c c}}w )NÚtext_config_dictÚimage_config_dictÚmultimodal_config_dictÚimage_codebook_config_dict)Útransformers_versionú`zp` is found in both `text_config_dict` and `text_config` but with different values. The value `text_config_dict["z"]` will be used instead.zk`text_config_dict` is provided which will be used to initialize `FlavaTextConfig`. The value `text_config["z"]` will be overridden.Úid2labelzs` is found in both `image_config_dict` and `image_config` but with different values. The value `image_config_dict["zn`image_config_dict` is provided which will be used to initialize `FlavaImageConfig`. The value `image_config["z‚` is found in both `multimodal_config_dict` and `multimodal_config` but with different values. The value `multimodal_config_dict["z}`multimodal_config_dict` is provided which will be used to initialize `FlavaMultimodalConfig`. The value `multimodal_config["zŽ` is found in both `image_codebook_config_dict` and `image_codebook_config` but with different values. The value `image_codebook_config_dict["zˆ`image_codebook_config_dict` is provided which will be used to initialize `FlavaImageCodebookConfig`. The value `image_codebook_config["zR`image_config` is `None`. initializing the `FlavaImageConfig` with default values.zP`text_config` is `None`. Initializing the `FlavaTextConfig` with default values.z\`multimodal_config` is `None`. initializing the `FlavaMultimodalConfig` with default values.zc`image_codebook_config` is `None`. initializing the `FlavaImageCodebookConfig` with default values.ç      ð?r   )"Úpopr   r   r<   Úto_dictÚitemsÚloggerÚinfoÚupdater	   rF   rH   rO   r   r>   rJ   rQ   r\   r]   r   r   r   r^   Úinitializer_factorr_   r`   ra   rb   rc   rd   re   rf   rg   rh   )"r    r   r>   rJ   rQ   r   r   r\   r]   r^   r   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   r!   rj   rk   rl   rm   Ú_text_config_dictÚkeyÚvalueÚmessageÚ_image_config_dictÚ_multimodal_config_dictÚ_image_codebook_config_dictr"   s"                                    €r#   r   zFlavaConfig.__init__Ù  sú  ø€ ð6 "Ÿ:™:Ð&8¸$Ó?ÐØ"ŸJ™JÐ':¸DÓAÐØ!'§¡Ð,DÀdÓ!KÐØ%+§Z¡ZÐ0LÈdÓ%SÐ"ä‰ÑÑ"˜6Ò"ð
 Ð'ØÐ"Ø �ô !0Ñ CÐ2BÑ C× KÑ KÓ MÐð 0×5Ñ5Ó7ò )‘
��UØ˜+Ò%¨%°;¸sÑ3CÓ*CÈÐSkÒHkàÐ.Ñ.à ˜uð %<Ø<?¸5Ð@Yð[ñ  ð3Ø36°%Ð7NðPð  ô —K‘K Õ(ð)ð" ×ÑÐ0Ô1àÐ(ØÐ#Ø!�ô "2Ñ!FÐ4EÑ!F×!NÑ!NÓ!PÐàÐ/Ñ/à6HÈÑ6T×6ZÑ6ZÓ6\÷2Ù(2¨¨U”C˜“H˜e‘Oó2Ð" :Ñ.ð
 1×6Ñ6Ó8ò )‘
��UØ˜,Ò&¨5°LÀÑ4EÓ+EÈ#ÐUmÒJmàÐ/Ñ/à ˜uð %EØEHÀEÐIbðdñ  ð8Ø8;°uÐ<SðUð  ô —K‘K Õ(ð)ð" ×ÑÐ 2Ô3à!Ð-Ø Ð(Ø$&Ð!ô '<Ñ&UÐ>TÑ&U×&]Ñ&]Ó&_Ð#ð 6×;Ñ;Ó=ò )‘
��UàÐ,Ò,ØÐ!2°3Ñ!7Ó7ØÐ#;Ò;ð Ð4Ñ4à ˜uð %TØTWÐSXÐXqðsñ  ðVØVYÐUZÐZqðsð  ô —K‘K Õ(ð%)ð* ×$Ñ$Ð%<Ô=à%Ð1Ø$Ð,Ø(*Ð%ô +CÑ*`ÐE_Ñ*`×*hÑ*hÓ*jÐ'ð :×?Ñ?ÓAò )‘
��UàÐ0Ò0ØÐ!6°sÑ!;Ó;ØÐ#;Ò;ð Ð8Ñ8à ˜uð %]Ø]`Ð\að b'ð'ñ  ð]Ø]`Ð\aÐaxðzð  ô —K‘K Õ(ð')ð, "×(Ñ(Ð)DÔEàÐØˆLÜ�K‰KÐlÔmàÐØˆKÜ�K‰KÐjÔkàÐ$Ø "ÐÜ�K‰KÐvÔwà Ð(Ø$&Ð!Ü�K‰KØuôô -Ñ<¨|Ñ<ˆÔÜ*Ñ9¨[Ñ9ˆÔÜ!6Ñ!KÐ9JÑ!KˆÔÜ%=Ñ%VÐ@UÑ%VˆÔ"Ø,ˆÔØ*ˆÔà&ˆÔØ,ˆÔØ!2ˆÔØ&<ˆÔ#Ø"%ˆÔØ.ˆÔØ$ˆŒØ$ˆŒØ)BˆÔ&Ø$ˆŒØ 0ˆÔØ.ˆÔØ+FˆÔ(Ø0PˆÔ-Ø&ˆÕùóA2s   ÄN<c                 óŒ   —  | d|j                  «       |j                  «       |j                  «       |j                  «       dœ|¤ŽS )a&  
        Instantiate a [`FlavaConfig`] (or a derived class) from flava text model configuration, flava image model
        configuration, flava multimodal model and flava codebook model configuration.

        Returns:
            [`FlavaConfig`]: An instance of a configuration object
        )r   r>   rJ   rQ   r   )rs   )Úclsr   r>   rJ   rQ   r!   s         r#   Úfrom_configszFlavaConfig.from_configs£  sP   € ñ" ð 
Ø%×-Ñ-Ó/Ø#×+Ñ+Ó-Ø/×7Ñ7Ó9Ø"7×"?Ñ"?Ó"Añ	
ð
 ñ
ð 	
r$   )NNNNr%   r+   r%   Tgƒ/L¦
F@r*   iœÿÿÿrq   rq   rq   rq   rq   rq   TTT)r0   r1   r2   r3   r4   r<   r	   rH   rO   Úsub_configsr   rF   r   r6   r7   r8   r   Úclassmethodr‚   r9   r:   s   @r#   rZ   rZ   ‹  s�  ø„ ñCðJ €Jà&Ø(Ø2Ø!9ñ	€Kð (,Ø&*Ø,0Ø04ØØ %Ø!Ø"Ø(.Ø#'Ø#ØØØ+.ØØ"%Ø!$Ø,0Ø15Ø ñ+H'à˜3 ˜8‘nðH'ð ˜#˜s˜(‘^ðH'ð    S ™>ð	H'ð
  $ C¨ H™~ðH'ð ðH'ð ðH'ð ðH'ð ðH'ð !&ðH'ð !ðH'ð ðH'ð ðH'ð ðH'ð $)ðH'ð  ð!H'ð"  ð#H'ð$ ð%H'ð& &*ð'H'ð( +/ð)H'ð* õ+H'ðT ð
à&ð
ð %ð
ð 1ð	
ð
  8ò
ó ô
r$   rZ   )rZ   rO   r	   rH   r<   N)r3   Útypingr   r   Úconfiguration_utilsr   Úutilsr   Ú
get_loggerr0   ru   r	   r<   rH   rO   rZ   Ú__all__r   r$   r#   ú<module>rŠ      s   ðñ !ç å 3Ý ð 
ˆ×	Ñ	˜HÓ	%€ôc%Ð'ô c%ôLn)Ð&ô n)ôbS+Ð,ô S+ôlA3Ð/ô A3ôHo
Ð"ô o
òd	 v�r$   