§
    ‚ŠtjÞ  ã                   óV  — 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dS )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<   dS )Ú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    © ó    úg/var/www/html/CA-Chatbot/venv/lib/python3.11/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                   ó|  — 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)<   dS )*Ú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Ð8Ñ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        �+t           	                    d¦  «         | j        | j        _        | j
        �+t           	                    d¦  «         | j
        | j        _
        | j        �+t           	                    d¦  «         | j        | j        _         t          ¦   «         j        di |¤Ž d S )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Ô0ð 	JÝ"2Ð"IÐ"I°TÔ5HÐ"IÐ"IˆDÔÝ�dÔ)­4Ñ0Ô0ð 	JÝ"2Ð"IÐ"I°TÔ5HÐ"IÐ"IˆDÔà59Ô5HÐ5T˜dÔ1Ð1ÕZjÑZlÔZlˆÔØ59Ô5HÐ5T˜dÔ1Ð1ÕZjÑZlÔZlˆÔà"&Ô"4Ð"@ˆDÔÐÐFgÐFgÐFgð 	Ôð
 ÔÐ(Ý×ÒðHñô ð ð 04Ô/@ˆDÔÔ,àÔÐ(Ý×ÒðHñô ð ð 04Ô/@ˆDÔÔ,àÔÐ(Ý×ÒðHñô ð ð 04Ô/@ˆDÔÔ,à�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r+   c                 óh   — | j         j        t          | j        ¦  «        k    rt	          d¦  «        ‚dS )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Ÿ   s6   € àÔÔ+­s°4Ô3EÑ/FÔ/FÒFÐFÝÐRÑSÔSÐSð GÐFr+   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   sZ  ø€ € € € € € ðð ð( €JØ#4Ð"5ÐØ%5ÐIYÐZÐZ€Kà59€NÐ$ tÑ+¨dÑ2Ð9Ð9Ñ9Ø59€NÐ$ tÑ+¨dÑ2Ð9Ð9Ñ9Ø€HˆeÐÐÑØ#Ð˜Ð#Ð#Ñ#Ø#€L�#˜‘*Ð#Ð#Ñ#Ø+/€L�#˜˜Sœ	‘/ DÑ(Ð/Ð/Ñ/Ø#€L�#˜‘*Ð#Ð#Ñ#Ø&*€M�4˜”9˜tÑ#Ð*Ð*Ñ*Ø#Ð�uÐ#Ð#Ñ#Ø€IˆtÐÐÑð"(ð "(ð "(ð "(ð "(ðHTð Tð 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Ð 3Ð 3Ð 3Ð 3Ð 3Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,ð 
ˆÔ	˜HÑ	%Ô	%€ð €Ð/Ð0Ñ0Ô0Øð$ð $ð $ð $ð $Ð'ñ $ô $ñ „ñ 1Ô0ð$ð" €Ð/Ð0Ñ0Ô0Øð#$ð #$ð #$ð #$ð #$Ð'ñ #$ô #$ñ „ñ 1Ô0ð#$ðL €Ð/Ð0Ñ0Ô0ØðO#ð O#ð O#ð O#ð O#Ð ñ O#ô O#ñ „ñ 1Ô0ðO#ðd @Ð
?Ð
?€€€r+   