§
    ‚ŠtjH-  ã                   óú  — d Z ddlmZ ddlmZ ddlmZ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 ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Z ed¬	¦  «        e G d„ de¦  «        ¦   «         ¦   «         Zg d¢ZdS )zBARK model configurationé    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringÚloggingé   )ÚCONFIG_MAPPINGÚ
AutoConfigz	suno/bark)Ú
checkpointc                   óº   — e Zd ZU dZdgZdddd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z  ed<   dZeed<   dZeed<   dZeed<   dS )ÚBarkSubModelConfigaþ  
    block_size (`int`, *optional*, defaults to 1024):
        The maximum sequence length that this model might ever be used with. Typically set this to something large
        just in case (e.g., 512 or 1024 or 2048).
    input_vocab_size (`int`, *optional*, defaults to 10_048):
        Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`{model}`]. Defaults to 10_048 but should be carefully thought with
        regards to the chosen sub-model.
    output_vocab_size (`int`, *optional*, defaults to 10_048):
        Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
        by the: `output_ids` when passing forward a [`{model}`]. Defaults to 10_048 but should be carefully thought
        with regards to the chosen sub-model.
    bias (`bool`, *optional*, defaults to `True`):
        Whether or not to use bias in the linear layers and layer norm layers.
    Úpast_key_valuesÚ	num_headsÚ
num_layersÚinput_vocab_sizeÚ
block_size)Únum_attention_headsÚnum_hidden_layersÚ
vocab_sizeÚwindow_sizei   i@'  Úoutput_vocab_sizeé   i   Úhidden_sizeg        ÚdropoutTÚbiasç{®Gáz”?Úinitializer_rangeÚ	use_cacheN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úkeys_to_ignore_at_inferenceÚattribute_mapr   ÚintÚ__annotations__r   r   r   r   r   r   Úfloatr   Úboolr   r   © ó    úi/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/bark/configuration_bark.pyr   r      sê   € € € € € € ðð ð  $5Ð"5Ðð  +Ø)Ø(Ø#ð	ð €Mð €J�ÐÐÑØ"Ð�cÐ"Ð"Ñ"Ø#Ð�sÐ#Ð#Ñ#Ø€J�ÐÐÑØ€IˆsÐÐÑØ€K�ÐÐÑØ€GˆU�S‰[ÐÐÑØ€Dˆ$ÐÐÑØ#Ð�uÐ#Ð#Ñ#Ø€IˆtÐÐÑÐÐr*   r   c                   ó   — e Zd ZdZdZdZdS )ÚBarkSemanticConfiga¯  
    block_size (`int`, *optional*, defaults to 1024):
        The maximum sequence length that this model might ever be used with. Typically set this to something large
        just in case (e.g., 512 or 1024 or 2048).
    input_vocab_size (`int`, *optional*, defaults to 10_048):
        Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`{model}`]. Defaults to 10_048 but should be carefully thought with
        regards to the chosen sub-model.
    output_vocab_size (`int`, *optional*, defaults to 10_048):
        Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
        by the: `output_ids` when passing forward a [`{model}`]. Defaults to 10_048 but should be carefully thought
        with regards to the chosen sub-model.
    bias (`bool`, *optional*, defaults to `True`):
        Whether or not to use bias in the linear layers and layer norm layers

    Example:

    ```python
    >>> from transformers import BarkSemanticConfig, BarkSemanticModel

    >>> # Initializing a Bark sub-module style configuration
    >>> configuration = BarkSemanticConfig()

    >>> # Initializing a model (with random weights) from the suno/bark style configuration
    >>> model = BarkSemanticModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```ÚsemanticÚsemantic_configN©r   r    r!   r"   Ú
model_typeÚbase_config_keyr)   r*   r+   r-   r-   B   s$   € € € € € ðð ð< €JØ'€O€O€Or*   r-   c                   ó   — e Zd ZdZdZdZdS )ÚBarkCoarseConfiga§  
    block_size (`int`, *optional*, defaults to 1024):
        The maximum sequence length that this model might ever be used with. Typically set this to something large
        just in case (e.g., 512 or 1024 or 2048).
    input_vocab_size (`int`, *optional*, defaults to 10_048):
        Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`{model}`]. Defaults to 10_048 but should be carefully thought with
        regards to the chosen sub-model.
    output_vocab_size (`int`, *optional*, defaults to 10_048):
        Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
        by the: `output_ids` when passing forward a [`{model}`]. Defaults to 10_048 but should be carefully thought
        with regards to the chosen sub-model.
    bias (`bool`, *optional*, defaults to `True`):
        Whether or not to use bias in the linear layers and layer norm layers

    Example:

    ```python
    >>> from transformers import BarkCoarseConfig, BarkCoarseModel

    >>> # Initializing a Bark sub-module style configuration
    >>> configuration = BarkCoarseConfig()

    >>> # Initializing a model (with random weights) from the suno/bark style configuration
    >>> model = BarkCoarseModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úcoarse_acousticsÚcoarse_acoustics_configNr0   r)   r*   r+   r4   r4   g   s$   € € € € € ðð ð< $€JØ/€O€O€Or*   r4   c                   óF   — e Zd ZU dZdZdZdZeed<   dZ	e
ed<   dZe
ed	<   d
S )ÚBarkFineConfigaå  
    block_size (`int`, *optional*, defaults to 1024):
        The maximum sequence length that this model might ever be used with. Typically set this to something large
        just in case (e.g., 512 or 1024 or 2048).
    input_vocab_size (`int`, *optional*, defaults to 10_048):
        Vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented by the
        `inputs_ids` passed when calling [`{model}`]. Defaults to 10_048 but should be carefully thought with
        regards to the chosen sub-model.
    output_vocab_size (`int`, *optional*, defaults to 10_048):
        Output vocabulary size of a Bark sub-model. Defines the number of different tokens that can be represented
        by the: `output_ids` when passing forward a [`{model}`]. Defaults to 10_048 but should be carefully thought
        with regards to the chosen sub-model.
    bias (`bool`, *optional*, defaults to `True`):
        Whether or not to use bias in the linear layers and layer norm layers
    n_codes_total (`int`, *optional*, defaults to 8):
        The total number of audio codebooks predicted. Used in the fine acoustics sub-model.
    n_codes_given (`int`, *optional*, defaults to 1):
        The number of audio codebooks predicted in the coarse acoustics sub-model. Used in the acoustics
        sub-models.

    Example:

    ```python
    >>> from transformers import BarkFineConfig, BarkFineModel

    >>> # Initializing a Bark sub-module style configuration
    >>> configuration = BarkFineConfig()

    >>> # Initializing a model (with random weights) from the suno/bark style configuration
    >>> model = BarkFineModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```Úfine_acousticsÚfine_acoustics_configTÚtie_word_embeddingsé   Ún_codes_totalé   Ún_codes_givenN)r   r    r!   r"   r1   r2   r;   r(   r&   r=   r%   r?   r)   r*   r+   r8   r8   Œ   sZ   € € € € € € ð!ð !ðF "€JØ-€Oà $Ð˜Ð$Ð$Ñ$Ø€M�3ÐÐÑØ€M�3ÐÐÑÐÐr*   r8   c                   ó¬   ‡ — e Zd ZU dZdZee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z  dz  ed<   dZeez  dz  ed<   d	Zeed
<   ˆ fd„Zˆ xZS )Ú
BarkConfigaf  
    semantic_config ([`BarkSemanticConfig`], *optional*):
        Configuration of the underlying semantic sub-model.
    coarse_acoustics_config ([`BarkCoarseConfig`], *optional*):
        Configuration of the underlying coarse acoustics sub-model.
    fine_acoustics_config ([`BarkFineConfig`], *optional*):
        Configuration of the underlying fine acoustics sub-model.
    codec_config ([`AutoConfig`], *optional*):
        Configuration of the underlying codec sub-model.

    Example:

    ```python
    >>> from transformers import (
    ...     BarkSemanticConfig,
    ...     BarkCoarseConfig,
    ...     BarkFineConfig,
    ...     BarkModel,
    ...     BarkConfig,
    ...     AutoConfig,
    ... )

    >>> # Initializing Bark sub-modules configurations.
    >>> semantic_config = BarkSemanticConfig()
    >>> coarse_acoustics_config = BarkCoarseConfig()
    >>> fine_acoustics_config = BarkFineConfig()
    >>> codec_config = AutoConfig.from_pretrained("facebook/encodec_24khz")


    >>> # Initializing a Bark module style configuration
    >>> configuration = BarkConfig(
    ...     semantic_config, coarse_acoustics_config, fine_acoustics_config, codec_config
    ... )

    >>> # Initializing a model (with random weights)
    >>> model = BarkModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úbark)r/   r6   r:   Úcodec_configNr/   r6   r:   rC   r   r   c                 ó°  •— | j         €.t          ¦   «         | _         t                               d¦  «         n0t	          | j         t
          ¦  «        rt          di | j         ¤Ž| _         | j        €.t          ¦   «         | _        t                               d¦  «         n0t	          | j        t
          ¦  «        rt          di | j        ¤Ž| _        | j        €.t          ¦   «         | _        t                               d¦  «         n0t	          | j        t
          ¦  «        rt          di | j        ¤Ž| _        | j
        €4t          d         ¦   «         | _
        t                               d¦  «         nQt	          | j
        t
          ¦  «        r7| j
                             dd¦  «        }t          |         di | j
        ¤Ž| _
         t          ¦   «         j        di |¤Ž d S )NzW`semantic_config` is `None`. Initializing the `BarkSemanticConfig` with default values.z]`coarse_acoustics_config` is `None`. Initializing the `BarkCoarseConfig` with default values.zY`fine_acoustics_config` is `None`. Initializing the `BarkFineConfig` with default values.ÚencodeczN`codec_config` is `None`. Initializing the `codec_config` with default values.r1   r)   )r/   r-   ÚloggerÚinfoÚ
isinstanceÚdictr6   r4   r:   r8   rC   r	   ÚgetÚsuperÚ__post_init__)ÚselfÚkwargsÚcodec_model_typeÚ	__class__s      €r+   rL   zBarkConfig.__post_init__ô   sÄ  ø€ ØÔÐ'Ý#5Ñ#7Ô#7ˆDÔ Ý�KŠKÐqÑrÔrÐrÐrÝ˜Ô,­dÑ3Ô3ð 	NÝ#5Ð#MÐ#M¸Ô8LÐ#MÐ#MˆDÔ àÔ'Ð/Ý+;Ñ+=Ô+=ˆDÔ(Ý�KŠKØoñô ð ð õ ˜Ô4µdÑ;Ô;ð 	\Ý+;Ð+[Ð+[¸dÔ>ZÐ+[Ð+[ˆDÔ(àÔ%Ð-Ý)7Ñ)9Ô)9ˆDÔ&Ý�KŠKÐsÑtÔtÐtÐtÝ˜Ô2µDÑ9Ô9ð 	VÝ)7Ð)UÐ)U¸$Ô:TÐ)UÐ)UˆDÔ&àÔÐ$Ý .¨yÔ 9Ñ ;Ô ;ˆDÔÝ�KŠKÐhÑiÔiÐiÐiÝ˜Ô)­4Ñ0Ô0ð 	VØ#Ô0×4Ò4°\À9ÑMÔMÐÝ .Ð/?Ô @Ð UÐ UÀ4ÔCTÐ UÐ UˆDÔà�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'r*   )r   r    r!   r"   r1   r-   r4   r8   r
   Úsub_configsr/   rI   r   r&   r6   r:   rC   r   r'   rL   Ú__classcell__)rP   s   @r+   rA   rA   º   så   ø€ € € € € € ð(ð (ðT €Jà-Ø#3Ø!/Ø"ð	ð €Kð 7;€O�TÐ,Ñ,¨tÑ3Ð:Ð:Ñ:Ø>BÐ˜TÐ$4Ñ4°tÑ;ÐBÐBÑBØ<@Ð˜4Ð"2Ñ2°TÑ9Ð@Ð@Ñ@Ø37€L�$Ð)Ñ)¨DÑ0Ð7Ð7Ñ7Ø#Ð�uÐ#Ð#Ñ#ð(ð (ð (ð (ð (ð (ð (ð (ð (r*   rA   )r4   rA   r8   r-   N)r"   Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r   Úautor	   r
   Ú
get_loggerr   rF   r   r-   r4   r8   rA   Ú__all__r)   r*   r+   ú<module>rY      s  ðð Ð à .Ð .Ð .Ð .Ð .Ð .à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø -Ð -Ð -Ð -Ð -Ð -Ð -Ð -ð 
ˆÔ	˜HÑ	%Ô	%€ð €˜;Ð'Ñ'Ô'Øð#ð #ð #ð #ð #Ð)ñ #ô #ñ „ñ (Ô'ð#ðL €˜;Ð'Ñ'Ô'Øð (ð  (ð  (ð  (ð  (Ð+ñ  (ô  (ñ „ñ (Ô'ð (ðF €˜;Ð'Ñ'Ô'Øð 0ð  0ð  0ð  0ð  0Ð)ñ  0ô  0ñ „ñ (Ô'ð 0ðF €˜;Ð'Ñ'Ô'Øð)ð )ð )ð )ð )Ð'ñ )ô )ñ „ñ (Ô'ð)ðX €˜;Ð'Ñ'Ô'ØðT(ð T(ð T(ð T(ð T(Ð!ñ T(ô T(ñ „ñ (Ô'ðT(ðn UÐ
TÐ
T€€€r*   