§
    9²¸j„  ã                   ó°   — 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neuphonic/neucodec)Ú
checkpointc                   ój  ‡ — 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         e"ed%f         z  ed,<   d-Z(eed.<   d/Z)eed0<   ˆ fd1„Z*d2„ Z+e,d3efd4„¦   «         Z-e,d3efd5„¦   «         Z.e,d3efd6„¦   «         Z/ˆ xZ0S )7ÚNeuCodecConfigaÉ  
    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.
    input_sampling_rate (`int`, *optional*, defaults to 16000):
        Sampling rate, in hertz (Hz), of the encoder's input audio waveform.
    output_sampling_rate (`int`, *optional*, defaults to 24000):
        Sampling rate, in hertz (Hz), of the decoder's output audio waveform.

    Example:

    ```python
    >>> from transformers import NeuCodecConfig, NeuCodecModel

    >>> # Initializing configuration
    >>> configuration = NeuCodecConfig()

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

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚneucodecÚ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_ratiosgš™™™™™¹?Úactivation_dropouti   Úquantization_dim)r*   r*   r*   r*   r*   r*   r*   r*   Úquantization_levelsi€>  Úinput_sampling_rateiÀ]  Úoutput_sampling_ratec                 ó¤  •— 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     €úƒ/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/transformers/models/neucodec/configuration_neucodec.pyr9   zNeuCodecConfig.__post_init__[   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©r:   s    r=   Úvalidate_architecturez$NeuCodecConfig.validate_architecturej   s[   € àÔ˜dÔ6Ñ6¸!Ò;Ð;Ýð7 DÔ$4ð 7ð 7ØÔ2ð7ð 7ð 7ñô ð ð <Ð;r>   Úreturnc                 óJ   — t          | j        | j        z  | j        z  ¦  «        S )N)ÚintÚencoder_hop_lengthr1   r0   rA   s    r=   Ú
hop_lengthzNeuCodecConfig.hop_lengthr   s%   € õ �4Ô*¨TÔ-FÑFÈÔIaÑaÑbÔbÐbr>   c                 ó   — | j         dz  S )Nr*   )rG   rA   s    r=   Ún_fftzNeuCodecConfig.n_fftx   s   € àŒ Ñ"Ð"r>   c                 óN   — t          t          j        | j        ¦  «        ¦  «        S )zhHop length, in samples at `input_sampling_rate`, between successive codes (i.e. the encoder frame rate).)rE   ÚnpÚprodr,   rA   s    r=   rF   z!NeuCodecConfig.encoder_hop_length|   s   € õ •2”7˜4Ô3Ñ4Ô4Ñ5Ô5Ð5r>   )1Ú__name__Ú
__module__Ú__qualname__Ú__doc__r3   Úkeys_to_ignore_at_inferencer   rE   Ú__annotations__r   r   r   r   r   Ústrr   r   r   Úfloatr   r    r!   Úboolr"   r   r6   r#   r$   r&   r   Úsub_configsr)   r,   ÚlistÚtupler'   r   r-   r.   r/   r0   r1   r9   rB   ÚpropertyrG   rI   rF   Ú__classcell__)r<   s   @r=   r   r      sÇ  ø€ € € € € € ðð ð: €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Ð@Ð@Ñ@Ø #Ð˜Ð#Ð#Ñ#Ø Ð�cÐ Ð Ñ Ø7OÐ˜˜cœ U¨3°¨8¤_Ñ4ÐOÐOÑOØ%Ð˜Ð%Ð%Ñ%Ø &Ð˜#Ð&Ð&Ñ&ð(ð (ð (ð (ð (ðð ð ð ðc˜Cð cð cð cñ „Xðcð
 ð#�sð #ð #ð #ñ „Xð#ð ð6 Cð 6ð 6ð 6ñ „Xð6ð 6ð 6ð 6ð 6r>   r   )ÚnumpyrK   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   Úutils.type_validatorsr   Úautor
   r   r   Ú__all__r4   r>   r=   ú<module>rc      sì   ðð* Ð Ð Ð Ø .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø #Ð #Ð #Ð #Ð #Ð #Ø -Ð -Ð -Ð -Ð -Ð -Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð €Ð/Ð0Ñ0Ô0Øð^6ð ^6ð ^6ð ^6ð ^6Ð%ñ ^6ô ^6ñ „ñ 1Ô0ð^6ðB Ð
€€€r>   