Ë
    ÜÓ^jq#  ã                   ó  — d dl mZ ddlmZ ddlm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)é    )Ústricté   )ÚPreTrainedConfig)Úauto_docstringznvidia/parakeet-ctc-1.1b)Ú
checkpointc                   ór  ‡ — e Zd ZU dZdZdg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z  ed<   dZeez  ed<   dZeez  ed <   dZeez  ed!<   dZeez  ed"<   d#Zeed$<   dZeed%<   d&Zeed'<   ˆ fd(„Z ˆ xZ!S ))ÚParakeetEncoderConfigaó  
    convolution_bias (`bool`, *optional*, defaults to `True`):
        Whether to use bias in convolutions of the conformer's convolution module.
    conv_kernel_size (`int`, *optional*, defaults to 9):
        The kernel size of the convolution layers in the Conformer block.
    subsampling_factor (`int`, *optional*, defaults to 8):
        The factor by which the input sequence is subsampled.
    subsampling_conv_channels (`int`, *optional*, defaults to 256):
        The number of channels in the subsampling convolution layers.
    num_mel_bins (`int`, *optional*, defaults to 80):
        Number of mel features.
    subsampling_conv_kernel_size (`int`, *optional*, defaults to 3):
        The kernel size of the subsampling convolution layers.
    subsampling_conv_stride (`int`, *optional*, defaults to 2):
        The stride of the subsampling convolution layers.
    dropout_positions (`float`, *optional*, defaults to 0.0):
        The dropout ratio for the positions in the input sequence.
    scale_input (`bool`, *optional*, defaults to `True`):
        Whether to scale the input embeddings.

    Example:
    ```python
    >>> from transformers import ParakeetEncoderModel, ParakeetEncoderConfig

    >>> # Initializing a `ParakeetEncoder` configuration
    >>> configuration = ParakeetEncoderConfig()

    >>> # Initializing a model from the configuration
    >>> model = ParakeetEncoderModel(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úparakeet_encoderÚpast_key_valuesé   Úhidden_sizeé   Únum_hidden_layersé   Únum_attention_headsi   Úintermediate_sizeÚsiluÚ
hidden_actTÚattention_biasÚconvolution_biasé	   Úconv_kernel_sizeÚsubsampling_factoré   Úsubsampling_conv_channelséP   Únum_mel_binsr   Úsubsampling_conv_kernel_sizeé   Úsubsampling_conv_stridegš™™™™™¹?Údropoutg        Údropout_positionsÚ	layerdropÚactivation_dropoutÚattention_dropoutiˆ  Úmax_position_embeddingsÚscale_inputg{®Gáz”?Úinitializer_rangec                 óF   •— | j                   | _        t        ‰| �  di |¤Ž y ©N© )r   Únum_key_value_headsÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €ú~/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/parakeet/configuration_parakeet.pyr.   z#ParakeetEncoderConfig.__post_init__T   s!   ø€ Ø#'×#;Ñ#;ˆÔ Ü‰ÑÑ' Ó'ó    )"Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú
model_typeÚkeys_to_ignore_at_inferencer   ÚintÚ__annotations__r   r   r   r   Ústrr   Úboolr   r   r   r   r   r   r    r!   Úfloatr"   r#   r$   r%   r&   r'   r(   r.   Ú__classcell__©r2   s   @r3   r	   r	      s  ø… ñ!ðF $€JØ#4Ð"5Ðà€K�ÓØÐ�sÓØ Ð˜Ó Ø!Ð�sÓ!Ø€J�ÓØ€N�DÓØ!Ð�dÓ!ØÐ�cÓØÐ˜ÓØ%(Ð˜sÓ(Ø€L�#ÓØ()Ð  #Ó)Ø#$Ð˜SÓ$Ø€GˆU�S‰[ÓØ%(Ð�u˜s‘{Ó(Ø €Iˆu�s‰{Ó Ø&)Ð˜ ™Ó)Ø%(Ð�u˜s‘{Ó(Ø#'Ð˜SÓ'Ø€K�ÓØ#Ð�uÓ#÷(ð (r4   r	   c                   óˆ   ‡ — e Zd ZU dZdZdeiZ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d
z  e	d<   ˆ fd„Zˆ xZS )ÚParakeetCTCConfiga  
    ctc_loss_reduction (`str`, *optional*, defaults to `"mean"`):
        Specifies the reduction to apply to the output of `torch.nn.CTCLoss`. Only relevant when training an
        instance of [`ParakeetForCTC`].
    ctc_zero_infinity (`bool`, *optional*, defaults to `True`):
        Whether to zero infinite losses and the associated gradients of `torch.nn.CTCLoss`. Infinite losses mainly
        occur when the inputs are too short to be aligned to the targets. Only relevant when training an instance
        of [`ParakeetForCTC`].
    encoder_config (`Union[dict, ParakeetEncoderConfig]`, *optional*):
        The config object or dictionary of the encoder.

    Example:

    ```python
    >>> from transformers import ParakeetForCTC, ParakeetCTCConfig
    >>> # Initializing a Parakeet configuration
    >>> configuration = ParakeetCTCConfig()
    >>> # Initializing a model from the configuration
    >>> model = ParakeetForCTC(configuration)
    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úparakeet_ctcÚencoder_configi  Ú
vocab_sizeÚmeanÚctc_loss_reductionTÚctc_zero_infinityNr   Úpad_token_idc                 óú   •— t        | j                  t        «      rt        di | j                  ¤Ž| _        n| j                  €t        «       | _        | j                  j                  | _        t        ‰| �  di |¤Ž y r*   ©Ú
isinstancerE   Údictr	   r(   r-   r.   r/   s     €r3   r.   zParakeetCTCConfig.__post_init__}   ód   ø€ Ü�d×)Ñ)¬4Ô0Ü"7Ñ"N¸$×:MÑ:MÑ"NˆDÕØ× Ñ Ð(Ü"7Ó"9ˆDÔØ!%×!4Ñ!4×!FÑ!FˆÔÜ‰ÑÑ' Ó'r4   )r5   r6   r7   r8   r9   r	   Úsub_configsrF   r;   r<   rH   r=   rI   r>   rE   rN   r   rJ   r.   r@   rA   s   @r3   rC   rC   Y   sg   ø… ñð0  €JØ#Ð%:Ð;€Kà€J�ÓØ$Ð˜Ó$Ø"Ð�tÓ"Ø59€N�DÐ+Ñ+¨dÑ2Ó9Ø#€L�#˜‘*Ó#÷(ð (r4   rC   znvidia/parakeet-rnnt-0.6bc                   óº   ‡ — e Zd ZU dZdZdei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z  dz  e	d<   dZee	d<   dZee	d<   dZee	d<   ˆ fd„Zˆ xZS )ÚParakeetRNNTConfiga  
    decoder_hidden_size (`int`, *optional*, defaults to 640):
        Hidden size of the LSTM prediction network and joint network.
    num_decoder_layers (`int`, *optional*, defaults to 2):
        Number of LSTM layers in the prediction network.
    max_symbols_per_step (`int`, *optional*, defaults to 10):
        Maximum number of symbols to emit per encoder time step during greedy decoding.
    encoder_config (`Union[dict, ParakeetEncoderConfig]`, *optional*):
        The config object or dictionary of the encoder.
    blank_token_id (`int`, *optional*, defaults to 8192):
        Blank token id. Different from `pad_token_id` for RNN-T.

    Example:
    ```python
    >>> from transformers import ParakeetForRNNT, ParakeetRNNTConfig

    >>> # Initializing a Parakeet RNN-T configuration
    >>> configuration = ParakeetRNNTConfig()

    >>> # Initializing a model from the configuration
    >>> model = ParakeetForRNNT(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úparakeet_rnntrE   i   rF   i€  Údecoder_hidden_sizer   Únum_decoder_layersÚrelur   é
   Úmax_symbols_per_stepNrJ   i    Úblank_token_idTÚis_encoder_decoderc                 óú   •— t        | j                  t        «      rt        di | j                  ¤Ž| _        n| j                  €t        «       | _        | j                  j                  | _        t        ‰| �  di |¤Ž y r*   rL   r/   s     €r3   r.   z ParakeetRNNTConfig.__post_init__±   rO   r4   )r5   r6   r7   r8   r9   r	   rP   rF   r;   r<   rT   rU   r   r=   rX   rE   rN   r   rJ   rY   rZ   r>   r.   r@   rA   s   @r3   rR   rR   †   s�   ø… ñð6 !€JØ#Ð%:Ð;€Kà€J�ÓØ"Ð˜Ó"ØÐ˜ÓØ€J�ÓØ "Ð˜#Ó"Ø59€N�DÐ+Ñ+¨dÑ2Ó9Ø€L�#ÓØ€N�CÓØ#Ð˜Ó#÷(ð (r4   rR   znvidia/parakeet-tdt-0.6b-v3c                   ó:   — e Zd ZU dZdZdZee   eedf   z  e	d<   y)ÚParakeetTDTConfigaR  
    A TDT (Token-and-Duration Transducer) extends the base RNN-T configuration [`ParakeetRNNTConfig`] with a
    `durations` field: the joint network gains a duration head (its output width grows from `vocab_size` to
    `vocab_size + len(durations)`), and during greedy decoding the encoder frame pointer advances by the
    predicted duration rather than a fixed single frame.

    decoder_hidden_size (`int`, *optional*, defaults to 640):
        Hidden size of the LSTM prediction network and joint network.
    num_decoder_layers (`int`, *optional*, defaults to 2):
        Number of LSTM layers in the prediction network.
    max_symbols_per_step (`int`, *optional*, defaults to 10):
        Maximum number of symbols to emit per encoder time step during greedy decoding.
    durations (`list[int]`, *optional*, defaults to `[0, 1, 2, 3, 4]`):
        Token duration values that can be predicted. Each value represents how many frames a token or blank
        emission spans.
    encoder_config (`Union[dict, ParakeetEncoderConfig]`, *optional*):
        The config object or dictionary of the encoder.
    blank_token_id (`int`, *optional*, defaults to 8192):
        Blank token id. Different from `pad_token_id` for TDT.

    Example:
    ```python
    >>> from transformers import ParakeetForTDT, ParakeetTDTConfig

    >>> # Initializing a Parakeet TDT configuration
    >>> configuration = ParakeetTDTConfig()

    >>> # Initializing a model from the configuration
    >>> model = ParakeetForTDT(configuration)

    >>> # Accessing the model configuration
    >>> configuration = model.config
    ```
    Úparakeet_tdt)r   é   r   r   é   .Ú	durationsN)
r5   r6   r7   r8   r9   ra   Úlistr;   Útupler<   r+   r4   r3   r]   r]   º   s*   … ñ!ðF  €JØ-<€Iˆt�C‰y˜5  c ™?Ñ*Ô<r4   r]   )rC   r	   rR   r]   N)Úhuggingface_hub.dataclassesr   Úconfiguration_utilsr   Úutilsr   r	   rC   rR   r]   Ú__all__r+   r4   r3   ú<module>rh      sÄ   ðõ /å 3Ý #ñ Ð5Ô6Øô?(Ð,ó ?(ó ó 7ð?(ñD Ð5Ô6Øô((Ð(ó ((ó ó 7ð((ñV Ð6Ô7Øô/(Ð)ó /(ó ó 8ð/(ñd Ð8Ô9Øô%=Ð*ó %=ó ó :ð%=òP d�r4   