Ë
    ÛÓ^jH)  ã                   ó  — d Z ddl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CLVP model configurationé    N)Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingzsusnato/clvp_dev)Ú
checkpointc                   ón  — e Zd ZU dZdZddg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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d z  ed!<   d"Zeee   z  d z  ed#<   d Zed z  ed$<   e	 d(d%eej>                  z  d&efd'„«       Z y ))ÚClvpEncoderConfiga¶  
    use_rotary_embedding (`bool`, *optional*, defaults to `True`):
        Whether to use rotary_embedding or not.
    use_attention_bias (`bool`, *optional*, defaults to `False`):
        Whether to use bias in Query, Key and Value layers during self attention.
    summary_type (`str`, *optional*, defaults to `"mean"`):
        What strategy to use to get pooler_output from the last_hidden_state. `"last"`, `"first"`, `"mean"` and
        `"cls_index"` are supported.

    Example:

    ```python
    >>> from transformers import ClvpEncoderConfig, ClvpEncoder

    >>> # Initializing a ClvpEncoderConfig with susnato/clvp_dev style configuration
    >>> encoder_configuration = ClvpEncoderConfig()

    >>> # Initializing a ClvpEncoder (with random weights) from the susnato/clvp_dev style configuration
    >>> model = ClvpEncoder(encoder_configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclvp_encoderÚtext_configÚspeech_configé   Ú
vocab_sizeé   Úhidden_sizei   Úintermediate_sizeÚprojection_dimé   Únum_hidden_layersé   Únum_attention_headsÚgeluÚ
hidden_actçñhãˆµøä>Úlayer_norm_epsçš™™™™™¹?Úattention_dropoutÚdropoutTÚuse_rotary_embeddingFÚuse_attention_biasÚmeanÚsummary_typeç      ð?Úinitializer_factoréÿ   NÚbos_token_idr   Úeos_token_idÚpad_token_idÚpretrained_model_name_or_pathÚconfig_typec                 óT  —  | j                   |fi |¤Ž\  }}|| j                  vrt        d|› �«      ‚|j                  d«      dk(  r||   }d|v rGt	        | d«      r;|d   | j
                  k7  r)t        j                  d|d   › d| j
                  › d�«        | j                  |fi |¤ŽS )NzSWe can only load either 'text_config' or 'speech_config' but you are trying to loadÚ
model_typeÚclvpzYou are using a model of type z  to instantiate a model of type zN. This is not supported for all configurations of models and can yield errors.)	Úget_config_dictÚbase_config_keyÚ
ValueErrorÚgetÚhasattrr,   ÚloggerÚwarningÚ	from_dict)Úclsr)   r*   ÚkwargsÚconfig_dicts        úv/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/clvp/configuration_clvp.pyÚfrom_pretrainedz!ClvpEncoderConfig.from_pretrainedK   sÔ   € ð 2˜c×1Ñ1Ð2OÑZÐSYÑZÑˆ�Vð ˜c×1Ñ1Ñ1ÜØeÐfqÐerÐsóð ð
 �?‰?˜<Ó(¨FÒ2Ø% kÑ2ˆKà˜;Ñ&¬7°3¸Ô+EÈ+ÐVbÑJcÐgj×guÑguÒJuÜ�N‰NØ0°¸\Ñ1JÐ0KÐKkØ—>‘>Ð"Ð"pðrôð
 ˆs�}‰}˜[Ñ3¨FÑ3Ð3ó    )r   )!Ú__name__Ú
__module__Ú__qualname__Ú__doc__r,   r/   r   ÚintÚ__annotations__r   r   r   r   r   r   Ústrr   Úfloatr   r   r   Úboolr    r"   r$   r&   r'   Úlistr(   ÚclassmethodÚosÚPathLiker:   © r;   r9   r
   r
      s  … ñð0  €JØ$ oÐ6€Oà€J�ÓØ€K�ÓØ!Ð�sÓ!Ø€N�CÓØÐ�sÓØ!Ð˜Ó!Ø€J�ÓØ €N�EÓ Ø%(Ð�u˜s‘{Ó(Ø€GˆU�S‰[ÓØ!%Ð˜$Ó%Ø$Ð˜Ó$Ø€L�#ÓØ #Ð˜Ó#Ø"€L�#˜‘*Ó"Ø+,€L�#˜˜S™	‘/ DÑ(Ó,Ø#€L�#˜‘*Ó#ààR_ñ4Ø,/°"·+±+Ñ,=ð4ØLOò4ó ñ4r;   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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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dz  ed"<   d Zeed#<   dZeez  ed$<   d Zeed%<   d&Zedz  ed'<   d(Z ee!e   z  d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/<   d0Z&e!e   e'ed1f   z  ed2<   d3Z(eed4<   y)5ÚClvpDecoderConfiga%
  
    max_text_tokens (`int`, *optional*, defaults to 404):
        The maximum sequence length of text tokens that this model might ever be used with. Similar to
        `n_positions` in `GPT2Config`.
    n_inner (`int`, *optional*):
        Dimensionality of the inner feed-forward layers. `None` will set it to 4 times `hidden_size`.
    num_mel_attn_blocks (`int`, *optional*, defaults to 6):
        Denotes the number of self attention layers in [`ClvpConditioningEncoder`].
    summary_type (`string`, *optional*, defaults to `"cls_index"`):
        Argument used when doing sequence summary.
        Has to be one of the following options:
            - `"last"`: Take the last token hidden state (like XLNet).
            - `"first"`: Take the first token hidden state (like BERT).
            - `"mean"`: Take the mean of all tokens hidden states.
            - `"cls_index"`: Supply a Tensor of classification token position (like GPT/GPT-2).
            - `"attn"`: Not implemented now, use multi-head attention.
    summary_use_proj (`bool`, *optional*, defaults to `True`):
        Whether or not to add a projection after the vector extraction.
    summary_activation (`str`, *optional*):
        Pass `"tanh"` for a tanh activation to the output, any other value will result in no activation.
    summary_proj_to_labels (`bool`, *optional*, defaults to `True`):
        Whether the projection outputs should have `config.num_labels` or `config.hidden_size` classes.
    summary_first_dropout (`float`, *optional*, defaults to 0.1):
        The dropout ratio to be used after the projection and activation.
    feature_size (`int`, *optional*, defaults to 80):
        The feature dimension of the extracted mel features. This value is used in [`ClvpConditioningEncoder`].
    use_attention_bias (`bool`, *optional*, defaults to `True`):
        Whether to use bias in Query, Key and Value layers during self attention.
    decoder_fixing_codes (`list`, *optional*, defaults to `[83, 45, 45, 248]`):
        These values are used in the method `fix_speech_decoder_output` to fix decoder generated outputs.

    Example:

    ```python
    >>> from transformers import ClvpDecoderConfig, ClvpDecoder

    >>> # Initializing a ClvpDecoderConfig with susnato/clvp_dev style configuration
    >>> decoder_configuration = ClvpDecoderConfig()

    >>> # Initializing a ClvpDecoder (with random weights) from the susnato/clvp_dev style configuration
    >>> model = ClvpDecoder(decoder_configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úclvp_decoderÚdecoder_configi   r   i`  Úmax_position_embeddingsi”  Úmax_text_tokensi   r   é   r   é   r   NÚn_inneré   Únum_mel_attn_blocksÚgelu_newÚactivation_functionr   Úresid_pdropÚ
embd_pdropr   r   Úlayer_norm_epsilong{®Gáz”?Úinitializer_rangeÚ	cls_indexr"   TÚsummary_use_projÚsummary_activationÚsummary_proj_to_labelsÚsummary_first_dropoutÚ	use_cachei    r&   i   r'   r(   éP   Úfeature_sizer    r#   r$   )éS   é-   rd   éø   .Údecoder_fixing_codesFÚadd_cross_attention))r<   r=   r>   r?   r,   r/   r   r@   rA   rN   rO   r   r   r   rR   rT   rV   rB   rW   rC   rX   r   rY   rZ   r"   r\   rD   r]   r^   r_   r`   r&   r'   rE   r(   rb   r    r$   rf   Útuplerg   rI   r;   r9   rK   rK   e   sz  … ñ,ð\  €JØ&€Oà€J�ÓØ#&Ð˜SÓ&Ø€O�SÓØ€K�ÓØÐ�sÓØ!Ð˜Ó!Ø€GˆS�4‰ZÓØ Ð˜Ó Ø)Ð˜Ó)Ø"€K�˜‘Ó"Ø!€J�˜‘Ó!Ø%(Ð�u˜s‘{Ó(Ø $Ð˜Ó$Ø#Ð�uÓ#Ø#€L�#Ó#Ø!Ð�dÓ!Ø%)Ð˜˜d™
Ó)Ø#'Ð˜DÓ'Ø),Ð˜5 3™;Ó,Ø€IˆtÓØ#€L�#˜‘*Ó#Ø+/€L�#˜˜S™	‘/ DÑ(Ó/Ø#€L�#˜‘*Ó#Ø€L�#ÓØ#Ð˜Ó#Ø #Ð˜Ó#Ø8IÐ˜$˜s™) e¨C°¨H¡oÑ5ÓIØ %Ð˜Ô%r;   rK   c                   ó¬   ‡ — e Zd ZU dZdZe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
z  dz  ed<   dZeed	<   d
Zeed<   dZeed<   ˆ fd„Zˆ xZS )Ú
ClvpConfigaÎ  
    speech_config (`dict`, *optional*):
        Dictionary of configuration options used to initialize CLVP speech encoder.
    decoder_config (`dict`, *optional*):
        Dictionary of configuration options used to initialize [`ClvpDecoderConfig`].

    Example:

    ```python
    >>> from transformers import ClvpConfig, ClvpModelForConditionalGeneration

    >>> # Initializing a ClvpConfig with susnato/clvp_dev style configuration
    >>> configuration = ClvpConfig()

    >>> # Initializing a ClvpModelForConditionalGeneration (with random weights) from the susnato/clvp_dev style configuration
    >>> model = ClvpModelForConditionalGeneration(configuration)

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

    >>> # We can also initialize a CLVPConfig from a CLVPTextConfig, CLVPSpeechConfig and a CLVPAutoRegressiveConfig
    >>> from transformers import ClvpEncoderConfig, ClvpDecoderConfig

    >>> # Initializing a CLVP text, CLVP speech and CLVP decoder configuration
    >>> config_text = ClvpEncoderConfig()
    >>> config_speech = ClvpEncoderConfig()
    >>> decoder_config = ClvpDecoderConfig()

    >>> config = ClvpConfig(config_text, config_speech, decoder_config)
    ```r-   )r   r   rM   Nr   r   rM   r   r   gƒ/L¦
F@Úlogit_scale_init_valuer#   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                  €%t        «       | _        t        j                  d«       n4t	        | j                  t
        «      rt        di | j                  ¤Ž| _        t        ‰| �(  di |¤Ž y )NzR`text_config` is `None`. initializing the `ClvpEncoderConfig` with default values.zT`speech_config` is `None`. initializing the `ClvpEncoderConfig` with default values.zS`image_config` is `None`. initializing the `ClvpDecoderConfig` with default values.rI   )r   r
   r3   ÚinfoÚ
isinstanceÚdictr   rM   rK   ÚsuperÚ__post_init__)Úselfr7   Ú	__class__s     €r9   rq   zClvpConfig.__post_init__ç   sñ   ø€ Ø×ÑÐ#Ü0Ó2ˆDÔÜ�K‰KÐlÕmÜ˜×(Ñ(¬$Ô/Ü0ÑD°4×3CÑ3CÑDˆDÔà×ÑÐ%Ü!2Ó!4ˆDÔÜ�K‰KÐnÕoÜ˜×*Ñ*¬DÔ1Ü!2Ñ!H°T×5GÑ5GÑ!HˆDÔà×ÑÐ&Ü"3Ó"5ˆDÔÜ�K‰KÐmÕnÜ˜×+Ñ+¬TÔ2Ü"3Ñ"J°d×6IÑ6IÑ"JˆDÔä‰ÑÑ' Ó'r;   )r<   r=   r>   r?   r,   r
   rK   Úsub_configsr   ro   r   rA   r   rM   r   r@   rk   rC   r$   rq   Ú__classcell__)rs   s   @r9   rj   rj   ·   sŠ   ø… ñð> €Jà(Ø*Ø+ñ€Kð 37€K�Ð(Ñ(¨4Ñ/Ó6Ø48€M�4Ð*Ñ*¨TÑ1Ó8Ø59€N�DÐ+Ñ+¨dÑ2Ó9Ø€N�CÓØ$*Ð˜EÓ*Ø #Ð˜Ó#÷(ð (r;   rj   )rj   rK   r
   )r?   rG   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Ú
get_loggerr<   r3   r
   rK   rj   Ú__all__rI   r;   r9   ú<module>r{      s¼   ðñ ã 	å .å 3ß ,ð 
ˆ×	Ñ	˜HÓ	%€ñ Ð-Ô.ØôE4Ð(ó E4ó ó /ðE4ñP Ð-Ô.ØôM&Ð(ó M&ó ó /ðM&ñ` Ð-Ô.ØôA(Ð!ó A(ó ó /ðA(òH C�r;   