Ë
    ÛÓ^j(  ã                   óà   — d dl mZ ddlmZ ddlmZ ddlmZmZ ddl	m
Z
  ej                  e«      Z ed¬	«      e G d
„ de«      «       «       Z ed¬	«      e G d„ de«      «       «       ZddgZy)é    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringÚloggingé   )Ú
AutoConfigzsesame/csm-1b)Ú
checkpointc                   ó¬  ‡ — e Zd ZU dZdZdZdgZddiZdZ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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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!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	Z%e
d	z  ed+<   ˆ fd,„Z&ˆ xZ'S )-ÚCsmDepthDecoderConfigañ  
    backbone_hidden_size (`int`, *optional*, defaults to 2048):
        Dimension of the hidden representations of the backbone model used with this depth decoder.

    Example:

    ```python
    >>> from transformers import CsmDepthDecoder, CsmDepthDecoderConfig

    >>> # Initializing a CsmDepthDecoder
    >>> configuration = CsmDepthDecoderConfig()
    >>> model = CsmDepthDecoderModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úcsm_depth_decoder_modelÚdepth_decoder_configÚpast_key_valuesÚcodebook_sizeÚ
vocab_sizeç    €„Aé    NÚnum_codebooksé   Úbackbone_hidden_sizeé  i   Úhidden_sizeé    Úintermediate_sizeé   Únum_hidden_layersé   Únum_attention_headsr	   Únum_key_value_headsÚsiluÚ
hidden_acté!   Úmax_position_embeddingsç{®Gáz”?Úinitializer_rangeçñhãˆµøä>Úrms_norm_epsTÚ	use_cacheÚpad_token_idÚbos_token_idÚeos_token_idÚrope_parametersFÚattention_biasç        Úattention_dropoutÚmlp_biasÚhead_dimc                 ó  •— |j                  dd«      rt        d«      ‚| j                  €| j                  | _        | j                  �| j                  n| j
                  | j                  z  | _        t        ‰| �  di |¤Ž y )NÚtie_word_embeddingsFzE`tie_word_embeddings=True` is not supported for CsmDepthDecoderConfig© )ÚpopÚ
ValueErrorr    r   r2   r   ÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €út/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/csm/configuration_csm.pyr9   z#CsmDepthDecoderConfig.__post_init__M   sr   ø€ Ø�:‰:Ð+¨UÔ3ÜÐdÓeÐeð ×#Ñ#Ð+Ø'+×'?Ñ'?ˆDÔ$Ø)-¯©Ð)B˜ŸšÈ×HXÑHXÐ\`×\tÑ\tÑHtˆŒÜ‰ÑÑ' Ó'ó    )(Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚbase_config_keyÚkeys_to_ignore_at_inferenceÚattribute_mapÚdefault_thetar   ÚintÚ__annotations__r   r   r   r   r   r   r    r"   Ústrr$   r&   Úfloatr(   r)   Úboolr*   r+   r,   Úlistr-   r   Údictr.   r0   r1   r2   r9   Ú__classcell__©r=   s   @r>   r   r      sH  ø… ñð" +€JØ,€OØ#4Ð"5Ðà˜ð€Mð €Mà "€M�3˜‘:Ó"Ø $Ð˜#Ó$Ø€J�ÓØ€K�ÓØ!Ð�sÓ!ØÐ�sÓØ Ð˜Ó Ø&'Ð˜˜t™Ó'Ø€J�ÓØ#%Ð˜SÓ%Ø#Ð�uÓ#Ø€L�%ÓØ€IˆtÓØ#€L�#˜‘*Ó#Ø#€L�#˜‘*Ó#Ø+/€L�#˜˜S™	‘/ DÑ(Ó/Ø48€O�^ dÑ*¨TÑ1Ó8Ø €N�DÓ Ø,/Ð�u˜s‘{ TÑ)Ó/Ø€HˆdÓØ€Hˆc�D‰jÓ÷(ð (r?   r   c                   óf  ‡ — e Zd ZU dZdZdZdgZdZee	dœZ
ddiZ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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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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!e   z  d
z  ed,<   d
Z&e'e(z  d
z  ed-<   d.Z)eed/<   d0Z*eez  d
z  ed1<   d.Z+eed2<   d
Z,ed
z  ed3<   dZ-ed
z  ed4<   d
Z.e(e/z  d
z  ed5<   d
Z0e(e/z  d
z  ed6<   ˆ fd7„Z1ˆ xZ2S )8Ú	CsmConfiga¬  
    codebook_pad_token_id (`int`, *optional*, defaults to 2050):
        Padding token id for codebook tokens.
    codebook_eos_token_id (`int`, *optional*, defaults to 0):
        End of stream token id for codebook tokens.
    audio_token_id (`int`, *optional*, defaults to 128002):
        Audio token id in the text input.
    audio_eos_token_id (`int`, *optional*, defaults to 128003):
        End of stream token id for audio in the text input.
    tie_codebooks_embeddings (`bool`, *optional*, defaults to `True`):
        Whether to tie the codebook tokens embeddings of the backbone model to the codebook tokens embeddings of the depth decoder.
    depth_decoder_config (`CsmDepthDecoderConfig`, *optional*):
        Configuration for the depth decoder.
    codec_config (`PreTrainedConfig`, *optional*):
        Configuration for the codec.

    ```python
    >>> from transformers import CsmForConditionalGeneration, CsmConfig

    >>> # Initializing a CsmConfig
    >>> configuration = CsmConfig()

    >>> # Initializing a model
    >>> model = CsmForConditionalGeneration(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    ÚcsmÚ
csm_configr   r   )Úcodec_configr   r   r   r   Nr   r   i õ Útext_vocab_sizer   r   r   r   é   r   r   r   r    r!   r"   r$   r%   r&   r'   r(   Tr)   iô r*   i  Úcodebook_pad_token_idr   Úcodebook_eos_token_idi ô r+   r,   Úaudio_token_idiô Úaudio_eos_token_idr-   Fr.   r/   r0   r1   r2   Útie_codebooks_embeddingsr   rV   c                 óÐ  •— |j                  dd«      rt        d«      ‚| j                  €%t        «       | _        t        j                  d«       n4t        | j                  t        «      rt        di | j                  ¤Ž| _        | j                  €0t        j                  d«      | _        t        j                  d«       n>t        | j                  t        «      r$t        j                  di | j                  ¤Ž| _        | j                  €| j                  | _        | j                  �| j                  n| j                  | j                  z  | _        d| _        t!        ‰| �D  di |¤Ž y )Nr4   Fz9`tie_word_embeddings=True` is not supported for CsmConfigzAdepth_decoder_config is None, using default depth decoder config.Úmimiz9codec_config is None, using default audio encoder config.r5   )r6   r7   r   r   ÚloggerÚinfoÚ
isinstancerO   rV   r
   Ú	for_modelr    r   r2   r   r4   r8   r9   r:   s     €r>   r9   zCsmConfig.__post_init__¢   s  ø€ Ø�:‰:Ð+¨UÔ3ÜÐXÓYÐYà×$Ñ$Ð,Ü(=Ó(?ˆDÔ%Ü�K‰KÐ[Õ\Ü˜×1Ñ1´4Ô8Ü(=Ñ(ZÀ×@YÑ@YÑ(ZˆDÔ%à×ÑÐ$Ü *× 4Ñ 4°VÓ <ˆDÔÜ�K‰KÐSÕTÜ˜×)Ñ)¬4Ô0Ü *× 4Ñ 4Ñ I°t×7HÑ7HÑ IˆDÔà×#Ñ#Ð+Ø'+×'?Ñ'?ˆDÔ$à)-¯©Ð)B˜ŸšÈ×HXÑHXÐ\`×\tÑ\tÑHtˆŒØ#(ˆÔ Ü‰ÑÑ' Ó'r?   )3r@   rA   rB   rC   rD   rE   rF   rH   r
   r   Úsub_configsrG   r   rI   rJ   r   rW   r   r   r   r   r    r"   rK   r$   r&   rL   r(   r)   rM   r*   rY   rZ   rN   r+   r,   r[   r\   r-   r   rO   r.   r0   r1   r2   r]   r   r   rV   r9   rP   rQ   s   @r>   rS   rS   X   sÝ  ø… ñð< €JØ"€OØ#4Ð"5ÐØ€Mà"Ø 5ñ€Kð
 	˜ð€Mð !#€M�3˜‘:Ó"Ø€J�ÓØ!€O�SÓ!Ø€K�ÓØ!Ð�sÓ!ØÐ�sÓØ!Ð˜Ó!Ø&'Ð˜˜t™Ó'Ø€J�ÓØ#'Ð˜SÓ'Ø#Ð�uÓ#Ø€L�%ÓØ€IˆtÓØ%€L�#˜‘*Ó%Ø(,Ð˜3 ™:Ó,Ø45Ð˜3  c¡™?¨TÑ1Ó5Ø%€L�#˜‘*Ó%Ø+/€L�#˜˜S™	‘/ DÑ(Ó/Ø!'€N�C˜$‘JÓ'Ø17Ð˜˜d 3™i™¨$Ñ.Ó7Ø48€O�^ dÑ*¨TÑ1Ó8Ø €N�DÓ Ø,/Ð�u˜s‘{ TÑ)Ó/Ø€HˆdÓØ€Hˆc�D‰jÓØ,0Ð˜d T™kÓ0Ø;?Ð˜$Ð!1Ñ1°DÑ8Ó?Ø37€L�$Ð)Ñ)¨DÑ0Ó7÷(ð (r?   rS   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   Úauto.configuration_autor
   Ú
get_loggerr@   r`   r   rS   Ú__all__r5   r?   r>   ú<module>rl      s�   ðõ  /å 3Ý 1ß ,Ý 0ð 
ˆ×	Ñ	˜HÓ	%€ñ ˜?Ô+Øô8(Ð,ó 8(ó ó ,ð8(ñv ˜?Ô+Øô](Ð ó ](ó ó ,ð](ðB Øð�r?   