Ë
    ÛÓ^jÞ  ã                   ó  — d Z ddlm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Dia model configurationé    )Ústricté   )ÚPreTrainedConfig)ÚRopeParameters)Úauto_docstringÚloggingznari-labs/Dia-1.6B)Ú
checkpointc                   óÀ   — e Zd ZU 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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<   y)ÚDiaEncoderConfigÚdia_encoderé   Úmax_position_embeddingsé   Únum_hidden_layersÚhidden_sizeé   Únum_attention_headsÚnum_key_value_headsé€   Úhead_dimi   Úintermediate_sizeçñhãˆµøä>Únorm_epsé   Ú
vocab_sizeÚsiluÚ
hidden_actNÚrope_parametersç{®Gáz”?Úinitializer_range)Ú__name__Ú
__module__Ú__qualname__Ú
model_typer   ÚintÚ__annotations__r   r   r   r   r   r   r   Úfloatr   r   Ústrr   Údictr    © ó    út/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/dia/configuration_dia.pyr   r      s‹   … ð €Jà#'Ð˜SÓ'ØÐ�sÓØ€K�ÓØ!Ð˜Ó!Ø!Ð˜Ó!Ø€HˆcÓØ!Ð�sÓ!Ø€HˆeÓØ€J�ÓØ€J�ÓØ#'€O�T˜D‘[Ó'Ø#Ð�uÔ#r+   r   c                   ót  — e Zd ZU 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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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dz  ed&<   dZ ee!e   z  dz  ed'<   d(Z"edz  ed)<   y)*ÚDiaDecoderConfiga)  
    cross_num_attention_heads (`int`, *optional*, defaults to 16):
        Number of attention heads for each cross-attention layer in the Transformer decoder.
    cross_head_dim (`int`, *optional*, defaults to 128):
        Dimensionality of the cross-attention head.
    cross_num_key_value_heads (`int`, *optional*, defaults to 16):
        Number of key and value heads for each cross-attention layer in the Transformer decoder.
    cross_hidden_size (`int`, *optional*, defaults to 1024):
        Dimensionality of the cross-attention layers.
    Údia_decoderi   r   é   r   i   r   i    r   r   r   é   r   r   r   Úcross_num_attention_headsÚcross_head_dimÚcross_num_key_value_headsr   Úcross_hidden_sizer   r   i  r   r   r   é	   Únum_channelsNr   r   r    TÚ	use_cacheÚis_encoder_decoderi  Úpad_token_idÚeos_token_idi  Úbos_token_id)#r!   r"   r#   Ú__doc__r$   r   r%   r&   r   r   r   r   r   r   r2   r3   r4   r5   r   r'   r   r   r(   r7   r   r   r)   r    r8   Úboolr9   r:   r;   Úlistr<   r*   r+   r,   r.   r.   -   s  … ñ	ð €Jà#'Ð˜SÓ'ØÐ�sÓØ€K�ÓØ!Ð�sÓ!Ø!Ð˜Ó!Ø Ð˜Ó Ø€HˆcÓØ%'Ð˜sÓ'Ø€N�CÓØ%'Ð˜sÓ'Ø!Ð�sÓ!Ø€HˆeÓØ€J�ÓØ€J�ÓØ€L�#ÓØ48€O�^ dÑ*¨TÑ1Ó8Ø#Ð�uÓ#Ø€IˆtÓØ#Ð˜Ó#Ø#€L�#˜‘*Ó#Ø+/€L�#˜˜S™	‘/ DÑ(Ó/Ø#€L�#˜‘*Ô#r+   r.   c                   ó  ‡ — e Zd ZU dZdZdgZ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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z  ed<   dZeed<   d
Zeed<   ˆ fd„Zd„ Zd„ Zˆ xZS )Ú	DiaConfigaP  
    delay_pattern (`list[int]`, *optional*, defaults to `[0, 8, 9, 10, 11, 12, 13, 14, 15]`):
        The delay pattern for the decoder. The length of this list must match `decoder_config.num_channels`.

    Example:

    ```python
    >>> from transformers import DiaConfig, DiaModel

    >>> # Initializing a DiaConfig with default values
    >>> configuration = DiaConfig()

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

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    ÚdiaÚpast_key_values)Úencoder_configÚdecoder_configNrD   rE   r   r   Tr9   r:   r;   r<   Údelay_patternr   r    r8   c                 ó:  •— t        | j                  t        «      rt        di | j                  ¤Ž| _        t        | j                  t        «      rt        di | j                  ¤Ž| _        | j                  �| j                  n	t        «       | _        | j                  �| j                  n	t        «       | _        | j                  �| j                  ng d¢| _        | j                  �0t        j                  d«       | j                  | j                  _        | j                  �0t        j                  d«       | j                  | j                  _
        | j                  �0t        j                  d«       | j                  | j                  _        t        ‰| �4  di |¤Ž y )N)	r   é   r6   é
   é   r   é   é   é   zjPassing `pad_token_id` to `DiaConfig` is deprecated. Please set it directly on `DiaDecoderConfig` instead.zjPassing `eos_token_id` to `DiaConfig` is deprecated. Please set it directly on `DiaDecoderConfig` instead.zjPassing `bos_token_id` to `DiaConfig` is deprecated. Please set it directly on `DiaDecoderConfig` instead.r*   )Ú
isinstancerD   r)   r   rE   r.   rF   r:   ÚloggerÚwarning_oncer;   r<   ÚsuperÚ__post_init__)ÚselfÚkwargsÚ	__class__s     €r,   rR   zDiaConfig.__post_init__{   s`  ø€ Ü�d×)Ñ)¬4Ô0Ü"2Ñ"I°T×5HÑ5HÑ"IˆDÔÜ�d×)Ñ)¬4Ô0Ü"2Ñ"I°T×5HÑ5HÑ"IˆDÔà59×5HÑ5HÐ5T˜d×1Ò1ÔZjÓZlˆÔØ59×5HÑ5HÐ5T˜d×1Ò1ÔZjÓZlˆÔà"&×"4Ñ"4Ð"@ˆD×ÒÒFgð 	Ôð
 ×ÑÐ(Ü×ÑðHôð 04×/@Ñ/@ˆD×ÑÔ,à×ÑÐ(Ü×ÑðHôð 04×/@Ñ/@ˆD×ÑÔ,à×ÑÐ(Ü×ÑðHôð 04×/@Ñ/@ˆD×ÑÔ,ä‰ÑÑ' Ó'r+   c                 ór   — | j                   j                  t        | j                  «      k7  rt	        d«      ‚y)zOPart of `@strict`-powered validation. Validates the architecture of the config.z3Number of channels must match delay pattern length.N)rE   r7   ÚlenrF   Ú
ValueError)rS   s    r,   Úvalidate_architecturezDiaConfig.validate_architectureŸ   s3   € à×Ñ×+Ñ+¬s°4×3EÑ3EÓ/FÒFÜÐRÓSÐSð Gr+   c                 ó   — | j                   S )z^Defaulting to audio config as it's the decoder in this case which is usually the text backbone)rE   )rS   ÚargsrT   s      r,   Úget_text_configzDiaConfig.get_text_config¤   s   € à×"Ñ"Ð"r+   )r!   r"   r#   r=   r$   Úkeys_to_ignore_at_inferencer   r.   Úsub_configsrD   r)   r&   rE   r   r'   r9   r>   r:   r%   r;   r?   r<   rF   r    r8   rR   rY   r\   Ú__classcell__)rU   s   @r,   rA   rA   U   sÎ   ø… ñð( €JØ#4Ð"5ÐØ%5ÐIYÑZ€Kà59€NÐ$ tÑ+¨dÑ2Ó9Ø59€NÐ$ tÑ+¨dÑ2Ó9Ø€HˆeÓØ#Ð˜Ó#Ø#€L�#˜‘*Ó#Ø+/€L�#˜˜S™	‘/ DÑ(Ó/Ø#€L�#˜‘*Ó#Ø&*€M�4˜‘9˜tÑ#Ó*Ø#Ð�uÓ#Ø€IˆtÓô"(òHTö
#r+   rA   )rA   r   r.   N)r=   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úmodeling_rope_utilsr   Úutilsr   r   Ú
get_loggerr!   rO   r   r.   rA   Ú__all__r*   r+   r,   ú<module>rf      sµ   ðñ å .å 3Ý 1ß ,ð 
ˆ×	Ñ	˜HÓ	%€ñ Ð/Ô0Øô$Ð'ó $ó ó 1ð$ñ" Ð/Ô0Øô#$Ð'ó #$ó ó 1ð#$ñL Ð/Ô0ØôO#Ð ó O#ó ó 1ðO#òd @�r+   