§
    ‚Štj^  ã                   ó°   — d dl Zd dlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZ dd	lmZmZ  e	d
¬¦  «        e G d„ de¦  «        ¦   «         ¦   «         ZdgZdS )é    N)Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstring)Úintervalé   )ÚCONFIG_MAPPINGÚ
AutoConfigzHKUSTAudio/xcodec2-hf)Ú
checkpointc                   ó@  ‡ — e Zd ZU dZdZ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<     ed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  dz  ed<   dZeed<   dZeez  dz  ed<   dZeed <   d!eiZd"Zeed#<   d$Z e!e         e"ed%f         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         e"ed%f         z  ed.<   ˆ fd/„Z)d0„ Z*e+d1efd2„¦   «         Z,e+d1efd3„¦   «         Z-ˆ xZ.S )4ÚXcodec2Configa©  
    downsampling_ratios (`list[int]`, *optional*, defaults to `[2, 2, 4, 4, 5]`):
        Ratios for downsampling in the encoder.
    semantic_model_config (`Union[Dict, Wav2Vec2BertConfig]`, *optional*):
        An instance of the configuration object for the semantic (Wav2Vec2BertConfig) model.
    quantization_dim (`int`, *optional*, defaults to 2048):
        Dimension for the vector quantization codebook.
    quantization_levels (`list[int]`, *optional*, defaults to `[4, 4, 4, 4, 4, 4, 4, 4]`):
        Levels for the vector quantization codebook.

    Example:

    ```python
    >>> from transformers import Xcodec2Config, Xcodec2Model

    >>> # Initializing configuration
    >>> configuration = Xcodec2Config()

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

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úxcodec2Úpast_key_valuesi   Úhidden_sizei   Úintermediate_sizeé   Únum_hidden_layersé   Únum_attention_headsÚnum_key_value_headsÚsiluÚ
hidden_actÚmax_position_embeddingsg        g      ð?)ÚminÚmaxg{®Gáz”?)ÚdefaultÚinitializer_rangeg�íµ ÷Æ°>Úrms_norm_epsNÚpad_token_idFÚtie_word_embeddingsÚrope_parametersÚattention_biasÚattention_dropouté@   Úhead_dimÚsemantic_model_configé0   Úencoder_hidden_size)r	   r	   é   r*   é   .Údownsampling_ratiosi€>  Úsampling_rategš™™™™™¹?Úactivation_dropouti   Úquantization_dim)r*   r*   r*   r*   r*   r*   r*   r*   Úquantization_levelsc                 ó¤  •— t          | j        t          ¦  «        rK| j                             dd¦  «        | j        d<   t	          | j        d                  di | j        ¤Ž| _        n"| j        €t	          d         d¬¦  «        | _        | j        €| j        | j        z  | _        | j        €| j        | _         t          ¦   «         j
        di |¤Ž d S )NÚ
model_typezwav2vec2-bertr   )r   © )Ú
isinstancer'   ÚdictÚgetr
   r&   r   r   r   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €úo/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/xcodec2/configuration_xcodec2.pyr8   zXcodec2Config.__post_init__V   sã   ø€ Ý�dÔ0µ$Ñ7Ô7ð 	_Ø7;Ô7Q×7UÒ7UÐVbÐdsÑ7tÔ7tˆDÔ& |Ñ4Ý)7¸Ô8RÐS_Ô8`Ô)að *ð *ØÔ,ð*ð *ˆDÔ&Ð&ð Ô'Ð/Ý)7¸Ô)HÐ[]Ð)^Ñ)^Ô)^ˆDÔ&ØŒ=Ð Ø Ô,°Ô0HÑHˆDŒMØÔ#Ð+Ø'+Ô'?ˆDÔ$à�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    c                 ól   — | j         | j        z  dk    r t          d| j         › d| j        › d�¦  «        ‚dS )zOPart of `@strict`-powered validation. Validates the architecture of the config.r   zThe hidden size (z6) is not a multiple of the number of attention heads (z).N)r   r   Ú
ValueError©r9   s    r<   Úvalidate_architecturez#Xcodec2Config.validate_architecturee   s[   € àÔ˜dÔ6Ñ6¸!Ò;Ð;Ýð7 DÔ$4ð 7ð 7ØÔ2ð7ð 7ð 7ñô ð ð <Ð;r=   Úreturnc                 óN   — t          t          j        | j        ¦  «        ¦  «        S )N)ÚintÚnpÚprodr,   r@   s    r<   Ú
hop_lengthzXcodec2Config.hop_lengthm   s   € å•2”7˜4Ô3Ñ4Ô4Ñ5Ô5Ð5r=   c                 ó   — | j         dz  S )Nr*   )rG   r@   s    r<   Ún_fftzXcodec2Config.n_fftq   s   € àŒ Ñ"Ð"r=   )/Ú__name__Ú
__module__Ú__qualname__Ú__doc__r2   Úkeys_to_ignore_at_inferencer   rD   Ú__annotations__r   r   r   r   r   Ústrr   r   r   Úfloatr   r    r!   Úboolr"   r   r5   r#   r$   r&   r   Úsub_configsr)   r,   ÚlistÚtupler'   r   r-   r.   r/   r0   r8   rA   ÚpropertyrG   rI   Ú__classcell__)r;   s   @r<   r   r      s‰  ø€ € € € € € ðð ð2 €JØ#4Ð"5ÐØ€K�ÐÐÑØ!Ð�sÐ!Ð!Ñ!ØÐ�sÐÐÑØ!Ð˜Ð!Ð!Ñ!Ø!Ð˜Ð!Ð!Ñ!Ø€J�ÐÐÑØ#'Ð˜SÐ'Ð'Ñ'Ø9˜x˜x¨C°SÐ9Ñ9Ô9À$ÐGÑGÔGÐ�uÐGÐGÑGØ€L�%ÐÐÑØ#€L�#˜‘*Ð#Ð#Ñ#Ø %Ð˜Ð%Ð%Ñ%Ø48€O�^ dÑ*¨TÑ1Ð8Ð8Ñ8Ø €N�DÐ Ð Ñ Ø,/Ð�s˜U‘{ TÑ)Ð/Ð/Ñ/Ø€HˆcÐÐÑØ*¨JÐ7€Kà!Ð˜Ð!Ð!Ñ!Ø7FÐ˜˜cœ U¨3°¨8¤_Ñ4ÐFÐFÑFØ<@Ð˜4Ð"2Ñ2°TÑ9Ð@Ð@Ñ@Ø€M�3ÐÐÑØ #Ð˜Ð#Ð#Ñ#Ø Ð�cÐ Ð Ñ Ø7OÐ˜˜cœ U¨3°¨8¤_Ñ4ÐOÐOÑOð(ð (ð (ð (ð (ðð ð ð ð6˜Cð 6ð 6ð 6ñ „Xð6ð ð#�sð #ð #ð #ñ „Xð#ð #ð #ð #ð #r=   r   )ÚnumpyrE   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   Úutils.type_validatorsr   Úautor
   r   r   Ú__all__r3   r=   r<   ú<module>r`      sì   ðð* Ð Ð Ð Ø .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø #Ð #Ð #Ð #Ð #Ð #Ø -Ð -Ð -Ð -Ð -Ð -Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð €Ð2Ð3Ñ3Ô3ØðR#ð R#ð R#ð R#ð R#Ð$ñ R#ô R#ñ „ñ 4Ô3ðR#ðj Ð
€€€r=   