
    i4                        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CLAP model configuration    )strict   )PreTrainedConfig)auto_docstringloggingzlaion/clap-htsat-fused)
checkpointc                   2   e Zd ZU dZ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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)$ClapTextConfiga  
    Examples:

    ```python
    >>> from transformers import ClapTextConfig, ClapTextModel

    >>> # Initializing a CLAP text configuration
    >>> configuration = ClapTextConfig()

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

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```clap_text_modeltext_configiY  
vocab_size   hidden_size   num_hidden_layersnum_attention_headsi   intermediate_sizegelu
hidden_act皙?hidden_dropout_probattention_probs_dropout_probi  max_position_embeddings   type_vocab_size      ?initializer_factorg-q=layer_norm_eps   projection_dimNpad_token_idr   bos_token_id   eos_token_idreluprojection_hidden_act)__name__
__module____qualname____doc__
model_typebase_config_keyr   int__annotations__r   r   r   r   r   strr   floatr   r   r   r   r   r    r!   r"   r$   listr&        |/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/transformers/models/clap/configuration_clap.pyr
   r
      s      #J#OJKs!!!s!J'**03 %#+3#&S&OS ##!NE!NC L#*  L#* +,L#S	/D(,!'3'r3   r
   c                      e Zd ZU dZ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e   z  eeef   z  ed<   dZeee   z  eedf   z  ed<   dZeed<   dZeed<   dZeed<   dZee   eedf   z  ed<   dZee   eedf   z  ed<   dZeed<   dZeez  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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/<   d0Z%eed1<   d2Z&eed3<   d4Z'eed5<   y)6ClapAudioConfiga  
    window_size (`int`, *optional*, defaults to 8):
        Image size of the spectrogram
    spec_size (`int`, *optional*, defaults to 256):
        Desired input size of the spectrogram that the model supports. It can be different from the output of the
        `ClapFeatureExtractor`, in which case the input features will be resized. Corresponds to the `image_size`
        of the audio models.
    patch_stride (`list`, *optional*, defaults to `[4, 4]`):
        Patch stride for the audio spectrogram
    num_classes (`int`, *optional*, defaults to 527):
        Number of classes used for the head training
    enable_fusion (`bool`, *optional*, defaults to `False`):
        Whether or not to enable patch fusion. This is the main contribution of the authors, and should give the
        best results.
    fusion_type (`[type]`, *optional*):
        Fusion type used for the patch fusion.
    patch_embed_input_channels (`int`, *optional*, defaults to 1):
        Number of channels used for the input spectrogram
    flatten_patch_embeds (`bool`, *optional*, defaults to `True`):
        Whether or not to flatten the patch embeddings
    patch_embeds_hidden_size (`int`, *optional*, defaults to 96):
        Hidden size of the patch embeddings. It is used as the number of output channels.
    enable_patch_layer_norm (`bool`, *optional*, defaults to `True`):
        Whether or not to enable layer normalization for the patch embeddings
    aff_block_r (`int`, *optional*, defaults to 4):
        downsize_ratio used in the AudioFF block

    Example:

    ```python
    >>> from transformers import ClapAudioConfig, ClapAudioModel

    >>> # Initializing a ClapAudioConfig with laion/clap-htsat-fused style configuration
    >>> configuration = ClapAudioConfig()

    >>> # Initializing a ClapAudioModel (with random weights) from the laion/clap-htsat-fused style configuration
    >>> model = ClapAudioModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```clap_audio_modelaudio_config   window_size@   num_mel_bins   	spec_sizer   r      
patch_size)r?   r?   .patch_stridei  num_classesr   r   r   r    )r#   r#      r#   depths)r?   r9          r   Fenable_fusionr   r   Nfusion_typer   patch_embed_input_channelsTflatten_patch_embeds`   patch_embeds_hidden_sizeenable_patch_layer_normg        drop_path_rater   qkv_biasg      @	mlp_ratioaff_block_rr   r%   r&   gh㈵>r   r   r   )(r'   r(   r)   r*   r+   r,   r:   r-   r.   r<   r>   r   r/   r@   r1   tuplerA   rB   r   r    rD   r   rG   boolr   r0   rH   rI   rJ   rL   rM   rN   r   rO   rP   rQ   r   r&   r   r   r2   r3   r4   r6   r6   B   s   (T $J$OKL#IsJ45Jd3i%S/156<L#S	/E#s(O3<KKNC*6FDIc3h'67EcU38_4EM4'**"Kt"&''!%$%$&c&$(T("%NECK%03 %#+3HdIuKs!'3' NE  ##r3   r6   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
<   dZeed<   dZeed<    fdZ xZS )
ClapConfiga.  
    Example:

    ```python
    >>> from transformers import ClapConfig, ClapModel

    >>> # Initializing a ClapConfig with laion-ai/base style configuration
    >>> configuration = ClapConfig()

    >>> # Initializing a ClapModel (with random weights) from the laion-ai/base style configuration
    >>> model = ClapModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config

    >>> # We can also initialize a ClapConfig from a ClapTextConfig and a ClapAudioConfig
    >>> from transformers import ClapTextConfig, ClapAudioConfig

    >>> # Initializing a ClapText and ClapAudioConfig configuration
    >>> config_text = ClapTextConfig()
    >>> config_audio = ClapAudioConfig()

    >>> config = ClapConfig(text_config=config_text, audio_config=config_audio)
    ```clap)r   r8   Nr   r8   g$I$I,@logit_scale_init_valuer   r    r%   r&   r   r   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                  | _        | j                  | j                   _        | j                  | j                  _        | j                  | j                   _	        | j                  | j                  _	        | j                   j                  | _
        | j                   j                  t        | j                  j                        z   | _        t        | <  di | y )NzO`text_config` is `None`. initializing the `ClapTextConfig` with default values.zQ`audio_config` is `None`. initializing the `ClapAudioConfig` with default values.r2   )r   r
   loggerinfo
isinstancedictr8   r6   r    r&   r   r   lenrD   super__post_init__)selfkwargs	__class__s     r4   r_   zClapConfig.__post_init__   s5   #-/DKKij(($/-A0@0@AD$ / 1DKKkl))40 / D$2C2C DD*.*=*='+/+>+>(151K1K.262L2L/++77!%!1!1!C!Cc$J[J[JbJbFc!c''r3   )r'   r(   r)   r*   r+   r
   r6   sub_configsr   r\   r   r.   r8   rW   r0   r    r-   r&   r/   r   r_   __classcell__)rb   s   @r4   rU   rU      sx    2 J"0/RK26K((4/637L$))D07$,E,NC!'3' ##( (r3   rU   )r6   rU   r
   N)r*   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   
get_loggerr'   rY   r
   r6   rU   __all__r2   r3   r4   <module>rj      s     . 3 , 
		H	% 34$(% $(  5$(N 34H$& H$  5H$V 348(! 8(  58(v >r3   