+
    œ°³j*:  ã                   ó¦   € R t ^ RIt^RIHt ^RIHt ]P                  ! ]4      t ! R R]4      t	 ! R R]4      t
 ! R R	]4      t ! R
 R]4      tR# )z#BARK model generation configurationN)ÚGenerationConfig)Úloggingc                   ó:   a a€ ] tR t^t oRtRV 3R lltRtVtV ;t# )ÚBarkSemanticGenerationConfigÚsemanticc                ó®   <€ \         SV `  ! RRVRV	RVRVRVRVRVRVR	V/	VB  W n        W°n        Wn        WÀn        WÐn        Wàn        Wðn        VV n	        R
# )a´
  Class that holds a generation configuration for [`BarkSemanticModel`].

This configuration inherit from [`GenerationConfig`] and can be used to control the model generation. Read the
documentation from [`GenerationConfig`] for more information.

Args:
    eos_token_id (`int`, *optional*, defaults to 10_000):
        The id of the *end-of-sequence* token.
    renormalize_logits (`bool`, *optional*, defaults to `True`):
        Whether to renormalize the logits after applying all the logits processors (including the
        custom ones). It's highly recommended to set this flag to `True` as the search algorithms suppose the
        score logits are normalized but some logit processors break the normalization.
    max_new_tokens (`int`, *optional*, defaults to 768):
        The maximum numbers of tokens to generate, ignoring the number of tokens in the prompt.
    output_scores (`bool`, *optional*, defaults to `False`):
        Whether or not to return the prediction scores. See `scores` under returned tensors for more details.
    return_dict_in_generate (`bool`, *optional*, defaults to `False`):
        Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
    output_hidden_states (`bool`, *optional*, defaults to `False`):
        Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
        for more details.
    output_attentions (`bool`, *optional*, defaults to `False`):
        Whether or not to return the attentions tensors of all attention layers. See `attentions` under
        returned tensors for more details.
    temperature (`float`, *optional*, defaults to 1.0):
        The value used to modulate the next token probabilities.
    do_sample (`bool`, *optional*, defaults to `False`):
        Whether or not to use sampling ; use greedy decoding otherwise.
    text_encoding_offset (`int`, *optional*, defaults to 10_048):
        Text encoding offset.
    text_pad_token (`int`, *optional*, defaults to 129_595):
        Text pad token.
    semantic_infer_token (`int`, *optional*, defaults to 129_599):
        Semantic infer token.
    semantic_vocab_size (`int`, *optional*, defaults to 10_000):
        Semantic vocab size.
    max_input_semantic_length (`int`, *optional*, defaults to 256):
        Max length of semantic input vector.
    semantic_rate_hz (`float`, *optional*, defaults to 49.9):
        Semantic rate in Hertz.
    min_eos_p (`float`, *optional*):
        Minimum threshold of the probability of the EOS token for it to be sampled. This is an early stopping
        strategy to mitigate potential unwanted generations at the end of a prompt. The original implementation
        suggests a default value of 0.2.
ÚtemperatureÚ	do_sampleÚeos_token_idÚrenormalize_logitsÚmax_new_tokensÚoutput_scoresÚreturn_dict_in_generateÚoutput_hidden_statesÚoutput_attentionsN© )
ÚsuperÚ__init__Útext_encoding_offsetÚtext_pad_tokenÚsemantic_pad_tokenÚsemantic_infer_tokenÚsemantic_vocab_sizeÚmax_input_semantic_lengthÚsemantic_rate_hzÚ	min_eos_p)Úselfr
   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   r   ÚkwargsÚ	__class__s   &&&&&&&&&&&&&&&&&,€Úw/home/luca/screen-checking/.venv/lib/python3.14/site-packages/transformers/models/bark/generation_configuration_bark.pyr   Ú%BarkSemanticGenerationConfig.__init__   s¦   ø€ ôB 	‰Òñ 	
Ø#ð	
àð	
ð &ð	
ð  2ð		
ð
 *ð	
ð (ð	
ð %<ð	
ð "6ð	
ð 0ð	
ð ò	
ð %9Ô!Ø,ÔØ".ÔØ$8Ô!Ø#6Ô Ø)BÔ&Ø 0ÔØ"ˆŽó    )r   r   r   r   r   r   r   r   )é'  Ti   FFFFç      ð?Fi@'  i;ú i?ú r"   é   g33333óH@N©	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú
model_typer   Ú__static_attributes__Ú__classdictcell__Ú__classcell__©r   Ú__classdict__s   @@r   r   r      s   ù‡ € Ø€J÷U#÷ U#r!   r   c                   óF   a a€ ] tR t^tt oRtRV3R lV 3R llltRtVtV ;t# )ÚBarkCoarseGenerationConfigÚcoarse_acousticsc                ó&   <€ V ^8„  d   QhRS[ RS[ /# )é   Úmax_coarse_historyÚsliding_window_len)Úint)Úformatr/   s   "€r   Ú__annotate__Ú'BarkCoarseGenerationConfig.__annotate__w   s%   ø€ ÷ J5ñ J5ñ  ðJ5ñ  ñJ5r!   c                ó˜   <€ \         SV `  ! R	RVRVRVRVRVRVRV/VB  W€n        W�n        W n        W°n        WÀn        WÐn        Wàn        R# )
aS	  Class that holds a generation configuration for [`BarkCoarseModel`].

This configuration inherit from [`GenerationConfig`] and can be used to control the model generation. Read the
documentation from [`GenerationConfig`] for more information.

Args:
    renormalize_logits (`bool`, *optional*, defaults to `True`):
        Whether to renormalize the logits after applying all the logits processors (including the
        custom ones). It's highly recommended to set this flag to `True` as the search algorithms suppose the
        score logits are normalized but some logit processors break the normalization.
    output_scores (`bool`, *optional*, defaults to `False`):
        Whether or not to return the prediction scores. See `scores` under returned tensors for more details.
    return_dict_in_generate (`bool`, *optional*, defaults to `False`):
        Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.
    output_hidden_states (`bool`, *optional*, defaults to `False`):
        Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors
        for more details.
    output_attentions (`bool`, *optional*, defaults to `False`):
        Whether or not to return the attentions tensors of all attention layers. See `attentions` under
        returned tensors for more details.
    temperature (`float`, *optional*, defaults to 1.0):
        The value used to modulate the next token probabilities.
    do_sample (`bool`, *optional*, defaults to `False`):
        Whether or not to use sampling ; use greedy decoding otherwise.
    coarse_semantic_pad_token (`int`, *optional*, defaults to 12_048):
        Coarse semantic pad token.
    coarse_rate_hz (`int`, *optional*, defaults to 75):
        Coarse rate in Hertz.
    n_coarse_codebooks (`int`, *optional*, defaults to 2):
        Number of coarse codebooks.
    coarse_infer_token (`int`, *optional*, defaults to 12_050):
        Coarse infer token.
    max_coarse_input_length (`int`, *optional*, defaults to 256):
        Max length of input coarse vector.
    max_coarse_history (`int`, *optional*, defaults to 630):
        Max length of the output of the coarse acoustics model used in the fine generation step.
    sliding_window_len (`int`, *optional*, defaults to 60):
        The coarse generation step uses a sliding window to generate raw audio.
r   r	   r   r   r   r   r   Nr   )	r   r   Úcoarse_semantic_pad_tokenÚcoarse_rate_hzÚn_coarse_codebooksÚcoarse_infer_tokenÚmax_coarse_input_lengthr5   r6   )r   r   r   r   r   r   r   r	   r<   r=   r>   r?   r@   r5   r6   r   r   s   &&&&&&&&&&&&&&&,€r   r   Ú#BarkCoarseGenerationConfig.__init__w   sŒ   ø€ ôr 	‰Òñ 		
Ø#ð		
àð		
ð  2ð		
ð (ð			
ð
 %<ð		
ð "6ð		
ð 0ð		
ð ò		
ð *CÔ&Ø,ÔØ"4ÔØ"4ÔØ'>Ô$Ø"4ÔØ"4Ör!   )r?   r=   r<   r5   r@   r>   r6   )TFFFFr#   Fi/  éK   r4   i/  r$   iv  é<   r%   r.   s   @@r   r1   r1   t   s   ù‡ € Ø#€J÷J5÷ J5õ J5r!   r1   c                   ó@   a a€ ] tR t^Ät oRtRV 3R lltR tRtVtV ;t	# )ÚBarkFineGenerationConfigÚfine_acousticsc                óL   <€ \         SV `  VR7       W n        W0n        W@n        R# )a:  Class that holds a generation configuration for [`BarkFineModel`].

[`BarkFineModel`] is an autoencoder model, so should not usually be used for generation. However, under the
hood, it uses `temperature` when used by [`BarkModel`]

This configuration inherit from [`GenerationConfig`] and can be used to control the model generation. Read the
documentation from [`GenerationConfig`] for more information.

Args:
    temperature (`float`, *optional*):
        The value used to modulate the next token probabilities.
    max_fine_history_length (`int`, *optional*, defaults to 512):
        Max length of the fine history vector.
    max_fine_input_length (`int`, *optional*, defaults to 1024):
        Max length of fine input vector.
    n_fine_codebooks (`int`, *optional*, defaults to 8):
        Number of codebooks used.
)r   N)r   r   Úmax_fine_history_lengthÚmax_fine_input_lengthÚn_fine_codebooks)r   r   rH   rI   rJ   r   r   s   &&&&&,€r   r   Ú!BarkFineGenerationConfig.__init__Ç   s'   ø€ ô4 	‰Ñ [ÐÔ1à'>Ô$Ø%:Ô"Ø 0Ör!   c                ó   € R# )zt
Overrides GenerationConfig.validate because BarkFineGenerationConfig don't use any parameters outside
temperature.
Nr   )r   r   s   &,r   ÚvalidateÚ!BarkFineGenerationConfig.validateç   s   ‚ r!   )rH   rI   rJ   )r#   i   é   é   )
r&   r'   r(   r)   r*   r   rM   r+   r,   r-   r.   s   @@r   rE   rE   Ä   s   ù‡ € Ø!€J÷1÷@ò r!   rE   c                   ó\   a € ] tR t^ît o RtR	V 3R lR llt]V 3R lR l4       tR tRt	V t
R# )
ÚBarkGenerationConfigÚbarkNc                óV   <€ V ^8„  d   QhRS[ R,          RS[ R,          RS[ R,          /# )r4   Úsemantic_configNÚcoarse_acoustics_configÚfine_acoustics_config)Údict)r8   r/   s   "€r   r9   Ú!BarkGenerationConfig.__annotate__ó   s5   ø€ ÷ /+ñ /+á �ð/+ñ "&¨¥ð/+ñ  $ d�{ñ	/+r!   c                ó   € Vf   / p\         P                  R4       Vf   / p\         P                  R4       Vf   / p\         P                  R4       \        R/ VB V n        \	        R/ VB V n        \        R/ VB V n        W@n        WPn	        R# )aœ  Class that holds a generation configuration for [`BarkModel`].

The [`BarkModel`] does not have a `generate` method, but uses this class to generate speeches with a nested
[`BarkGenerationConfig`] which uses [`BarkSemanticGenerationConfig`], [`BarkCoarseGenerationConfig`],
[`BarkFineGenerationConfig`].

This configuration inherit from [`GenerationConfig`] and can be used to control the model generation. Read the
documentation from [`GenerationConfig`] for more information.

Args:
    semantic_config (`Dict`, *optional*):
        Semantic generation configuration.
    coarse_acoustics_config (`Dict`, *optional*):
        Coarse generation configuration.
    fine_acoustics_config (`Dict`, *optional*):
        Fine generation configuration.
    sample_rate (`int`, *optional*, defaults to 24_000):
        Sample rate.
    codebook_size (`int`, *optional*, defaults to 1024):
        Vector length for each codebook.
NzMsemantic_config is None. initializing the semantic model with default values.zScoarse_acoustics_config is None. initializing the coarse model with default values.zOfine_acoustics_config is None. initializing the fine model with default values.r   )
ÚloggerÚinfor   rU   r1   rV   rE   rW   Úsample_rateÚcodebook_size)r   rU   rV   rW   r]   r^   r   s   &&&&&&,r   r   ÚBarkGenerationConfig.__init__ó   sŒ   € ð< Ò"Ø ˆOÜ�K‰KÐgÔhà"Ò*Ø&(Ð#Ü�K‰KÐmÔnà Ò(Ø$&Ð!Ü�K‰KÐiÔjä;ÑN¸oÑNˆÔÜ'AÑ'\ÐD[Ñ'\ˆÔ$Ü%=Ñ%VÐ@UÑ%VˆÔ"à&ÔØ*Ör!   c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# )r4   rU   rV   rW   )r   r1   rE   )r8   r/   s   "€r   r9   rY   %  s)   ø€ ÷ 
ñ 
á5ð
ñ "<ð
ñ  8ñ	
r!   c           
     ór   € V ! RRVP                  4       RVP                  4       RVP                  4       /VB # )zº
Instantiate a [`BarkGenerationConfig`] (or a derived class) from bark sub-models generation configuration.

Returns:
    [`BarkGenerationConfig`]: An instance of a configuration object
rU   rV   rW   r   )Úto_dict)ÚclsrU   rV   rW   r   s   &&&&,r   Úfrom_sub_model_configsÚ+BarkGenerationConfig.from_sub_model_configs$  sP   € ñ ñ 
Ø+×3Ñ3Ó5ð
à$;×$CÑ$CÓ$Eð
ð #8×"?Ñ"?Ó"Að
ð ñ	
ð 	
r!   c                ó&  € \         P                  ! V P                  4      pV P                  P	                  4       VR&   V P
                  P	                  4       VR&   V P                  P	                  4       VR&   V P                  P                  VR&   V# )zÑ
Serializes this instance to a Python dictionary. Override the default [`~PreTrainedConfig.to_dict`].

Returns:
    `dict[str, any]`: Dictionary of all the attributes that make up this configuration instance,
rU   rV   rW   r*   )	ÚcopyÚdeepcopyÚ__dict__rU   rb   rV   rW   r   r*   )r   Úoutputs   & r   rb   ÚBarkGenerationConfig.to_dict9  s}   € ô —’˜tŸ}™}Ó-ˆà$(×$8Ñ$8×$@Ñ$@Ó$BˆÐ Ñ!Ø,0×,HÑ,H×,PÑ,PÓ,RˆÐ(Ñ)Ø*.×*DÑ*D×*LÑ*LÓ*NˆÐ&Ñ'à#Ÿ~™~×8Ñ8ˆˆ|ÑØˆr!   )rV   r^   rW   r]   rU   )NNNiÀ]  rO   )r&   r'   r(   r)   r*   r   Úclassmethodrd   rb   r+   r,   )r/   s   @r   rR   rR   î   s3   ø‡ € Ø€J÷/+ò /+ðb ÷
ó ð
÷(ð r!   rR   )Ú__doc__rg   Úgeneration.configuration_utilsr   Úutilsr   Ú
get_loggerr&   r[   r   r1   rE   rR   r   r!   r   Ú<module>rq      sb   ðñ *ã å >Ý ð 
×	Ò	˜HÓ	%€ôX#Ð#3ô X#ôvM5Ð!1ô M5ô`'Ð/ô 'ôTYÐ+ö Yr!   