§
    ‚ŠtjH)  ã                   óR  — 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dS )zCLVP model configurationé    N)Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingzsusnato/clvp_dev)Ú
checkpointc                   ór  — 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 d S ))Ú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                 óZ  —  | j         |fi |¤Ž\  }}|| j        vrt          d|› �¦  «        ‚|                     d¦  «        dk    r||         }d|v rMt	          | d¦  «        r=|d         | j        k    r,t                               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        úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/clvp/configuration_clvp.pyÚfrom_pretrainedz!ClvpEncoderConfig.from_pretrainedK   s  € ð 2˜cÔ1Ð2OÐZÐZÐSYÐZÐZÑˆ�Vð ˜cÔ1Ð1Ð1ÝØsÐfqÐsÐsñô ð ð
 �?Š?˜<Ñ(Ô(¨FÒ2Ð2Ø% kÔ2ˆKà˜;Ð&Ð&­7°3¸Ñ+EÔ+EÐ&È+ÐVbÔJcÐgjÔguÒJuÐJuÝ�NŠNðr°¸\Ô1Jð rð rØ”>ðrð rð rñô ð ð
 ˆsŒ}˜[Ð3Ð3¨FÐ3Ð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Ø,/°"´+Ñ,=ð4ØLOð4ð 4ð 4ñ „[ð4ð 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<   dS )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   s7  € € € € € € ð,ð ,ð\  €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ÐIÑ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                               d¦  «         n0t	          | j         t
          ¦  «        rt          di | j         ¤Ž| _         | j        €.t          ¦   «         | _        t                               d¦  «         n0t	          | j        t
          ¦  «        rt          di | j        ¤Ž| _        | j        €.t          ¦   «         | _        t                               d¦  «         n0t	          | j        t
          ¦  «        rt          di | j        ¤Ž| _         t          ¦   «         j
        di |¤Ž d S )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Ô2ˆDÔÝ�KŠKÐlÑmÔmÐmÐmÝ˜Ô(­$Ñ/Ô/ð 	EÝ0ÐDÐD°4Ô3CÐDÐDˆDÔàÔÐ%Ý!2Ñ!4Ô!4ˆDÔÝ�KŠKÐnÑoÔoÐoÐoÝ˜Ô*­DÑ1Ô1ð 	IÝ!2Ð!HÐ!H°TÔ5GÐ!HÐ!HˆDÔàÔÐ&Ý"3Ñ"5Ô"5ˆDÔÝ�KŠKÐmÑnÔnÐnÐnÝ˜Ô+­TÑ2Ô2ð 	KÝ"3Ð"JÐ"J°dÔ6IÐ"JÐ"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Ð6Ñ6Ø48€M�4Ð*Ñ*¨TÑ1Ð8Ð8Ñ8Ø59€N�DÐ+Ñ+¨dÑ2Ð9Ð9Ñ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Ð 3Ð 3Ð 3Ð 3Ð 3Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð 
ˆÔ	˜HÑ	%Ô	%€ð €Ð-Ð.Ñ.Ô.ØðE4ð E4ð E4ð E4ð E4Ð(ñ E4ô E4ñ „ñ /Ô.ðE4ðP €Ð-Ð.Ñ.Ô.ØðM&ð M&ð M&ð M&ð M&Ð(ñ M&ô M&ñ „ñ /Ô.ðM&ð` €Ð-Ð.Ñ.Ô.ØðA(ð A(ð A(ð A(ð A(Ð!ñ A(ô A(ñ „ñ /Ô.ðA(ðH CÐ
BÐ
B€€€r;   