Ë
    ÛÓ^jH-  ã                   ó„  — 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y)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<   y)Ú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   © ó    úv/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/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y)Ú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Ø'�Or*   r-   c                   ó   — e Zd ZdZdZdZy)Ú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Ø/�Or*   r4   c                   óD   — 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	<   y
)Ú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   Œ   s3   … ñ!ð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        j                  d«       n4t	        | j                   t
        «      rt        di | j                   ¤Ž| _         | j                  €%t        «       | _        t        j                  d«       n4t	        | j                  t
        «      rt        di | j                  ¤Ž| _        | j                  €%t        «       | _        t        j                  d«       n4t	        | j                  t
        «      rt        di | j                  ¤Ž| _        | j                  €(t        d   «       | _
        t        j                  d«       nSt	        | j                  t
        «      r9| j                  j                  dd«      }t        |   di | j                  ¤Ž| _
        t        ‰| �8  di |¤Ž y )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__ô   sc  ø€ Ø×ÑÐ'Ü#5Ó#7ˆDÔ Ü�K‰KÐqÕrÜ˜×,Ñ,¬dÔ3Ü#5Ñ#M¸×8LÑ8LÑ#MˆDÔ à×'Ñ'Ð/Ü+;Ó+=ˆDÔ(Ü�K‰KØoõô ˜×4Ñ4´dÔ;Ü+;Ñ+[¸d×>ZÑ>ZÑ+[ˆDÔ(à×%Ñ%Ð-Ü)7Ó)9ˆDÔ&Ü�K‰KÐsÕtÜ˜×2Ñ2´DÔ9Ü)7Ñ)U¸$×:TÑ:TÑ)UˆDÔ&à×ÑÐ$Ü .¨yÑ 9Ó ;ˆDÔÜ�K‰KÐhÕiÜ˜×)Ñ)¬4Ô0Ø#×0Ñ0×4Ñ4°\À9ÓMÐÜ .Ð/?Ñ @Ñ UÀ4×CTÑCTÑ 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Ø<@Ð˜4Ð"2Ñ2°TÑ9Ó@Ø37€L�$Ð)Ñ)¨DÑ0Ó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ß ,ß -ð 
ˆ×	Ñ	˜HÓ	%€ñ ˜;Ô'Øô#Ð)ó #ó ó (ð#ñL ˜;Ô'Øô (Ð+ó  (ó ó (ð (ñF ˜;Ô'Øô 0Ð)ó  0ó ó (ð 0ñF ˜;Ô'Øô)Ð'ó )ó ó (ð)ñX ˜;Ô'ØôT(Ð!ó T(ó ó (ðT(òn U�r*   