
    Z jH-                     f   S r SSKJr  SSKJr  SSKJrJr  SSKJ	r	J
r
  \R                  " \5      r\" SS	9\ " S
 S\5      5       5       r\" SS	9\ " S S\5      5       5       r\" SS	9\ " S S\5      5       5       r\" SS	9\ " S S\5      5       5       r\" SS	9\ " S S\5      5       5       r/ SQrg)zBARK model configuration    )strict   )PreTrainedConfig)auto_docstringlogging   )CONFIG_MAPPING
AutoConfigz	suno/bark)
checkpointc                       \ rS rSr% SrS/rSSSSS.rS	r\\	S'   S
r
\\	S'   S
r\\	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Sr\\-  \	S'   Sr\\	S'   Sr\\	S'   Sr\\	S'   Srg)BarkSubModelConfig   a  
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{Gz?initializer_range	use_cache N)__name__
__module____qualname____firstlineno____doc__keys_to_ignore_at_inferenceattribute_mapr   int__annotations__r   r   r   r   r   r   floatr   boolr   r   __static_attributes__r        |/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/bark/configuration_bark.pyr   r      s      $5"5  +)(#	M J"c"#s#JIsKGUS[D$#u#Itr-   r   c                        \ rS rSrSrSrSrSrg)BarkSemanticConfigB   aS  
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_configr    Nr!   r"   r#   r$   r%   
model_typebase_config_keyr,   r    r-   r.   r0   r0   B   s    < J'Or-   r0   c                        \ rS rSrSrSrSrSrg)BarkCoarseConfigg   aK  
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_configr    Nr4   r    r-   r.   r8   r8   g   s    < $J/Or-   r8   c                   L    \ rS rSr% SrSrSrSr\\	S'   Sr
\\	S'   S	r\\	S
'   Srg)BarkFineConfig   au  
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_givenr    N)r!   r"   r#   r$   r%   r5   r6   rA   r+   r)   rC   r(   rE   r,   r    r-   r.   r=   r=      s3    !F "J-O $$M3M3r-   r=   c                      ^  \ rS rSr% SrSr\\\\	S.r
Sr\\-  S-  \S'   Sr\\-  S-  \S'   Sr\\-  S-  \S'   Sr\\-  S-  \S	'   S
r\\S'   U 4S jrSrU =r$ )
BarkConfig   a  
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)r3   r;   r@   codec_configNr3   r;   r@   rJ   r   r   c                   > U R                   c%  [        5       U l         [        R                  S5        O9[	        U R                   [
        5      (       a  [        S0 U R                   D6U l         U R                  c%  [        5       U l        [        R                  S5        O9[	        U R                  [
        5      (       a  [        S0 U R                  D6U l        U R                  c%  [        5       U l        [        R                  S5        O9[	        U R                  [
        5      (       a  [        S0 U R                  D6U l        U R                  c)  [        S   " 5       U l
        [        R                  S5        OY[	        U R                  [
        5      (       a:  U R                  R                  SS5      n[        U   " S0 U R                  D6U l
        [        TU ]8  " S0 UD6  g )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.r5   r    )r3   r0   loggerinfo
isinstancedictr;   r8   r@   r=   rJ   r	   getsuper__post_init__)selfkwargscodec_model_type	__class__s      r.   rS   BarkConfig.__post_init__   so   '#5#7D KKqr,,d33#5#M8L8L#MD ''/+;+=D(KKo 44d;;+;+[d>Z>Z+[D(%%-)7)9D&KKst22D99)7)U$:T:T)UD&$ .y 9 ;DKKhi))400#0044\9M ./? @ U4CTCT UD''r-   )r;   rJ   r@   r3   )r!   r"   r#   r$   r%   r5   r0   r8   r=   r
   sub_configsr3   rP   r   r)   r;   r@   rJ   r   r*   rS   r,   __classcell__)rW   s   @r.   rG   rG      s    (T J-#3!/"	K 7;OT,,t3:>BT$44t;B<@4"22T9@37L$))D07#u#( (r-   rG   )r8   rG   r=   r0   N)r%   huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   autor	   r
   
get_loggerr!   rM   r   r0   r8   r=   rG   __all__r    r-   r.   <module>ra      s    . 3 , - 
		H	% ;'#) #  (#L ;' (+  (  ( (F ;' 0)  0  ( 0F ;')' )  ()X ;'T(! T(  (T(n Ur-   