§
    ‚Štjq#  ã                   ór  — 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
dS )é    )Ú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                 óR   •— | j         | _         t          ¦   «         j        di |¤Ž d S ©N© )r   Únum_key_value_headsÚsuperÚ__post_init__©ÚselfÚkwargsÚ	__class__s     €úq/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/transformers/models/parakeet/configuration_parakeet.pyr.   z#ParakeetEncoderConfig.__post_init__T   s1   ø€ Ø#'Ô#;ˆÔ Ø�‰ŒÔÐ'Ð' Ð'Ð'Ð'Ð'Ð'ó    )"Ú__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          ¦   «         j        di |¤Ž d S r*   ©Ú
isinstancerE   Údictr	   r(   r-   r.   r/   s     €r3   r.   zParakeetCTCConfig.__post_init__}   ó|   ø€ Ý�dÔ)­4Ñ0Ô0ð 	:Ý"7Ð"NÐ"N¸$Ô:MÐ"NÐ"NˆDÔÐØÔ Ð(Ý"7Ñ"9Ô"9ˆDÔØ!%Ô!4Ô!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   s·   ø€ € € € € € ðð ð0  €JØ#Ð%:Ð;€Kà€J�ÐÐÑØ$Ð˜Ð$Ð$Ñ$Ø"Ð�tÐ"Ð"Ñ"Ø59€N�DÐ+Ñ+¨dÑ2Ð9Ð9Ñ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          ¦   «         j        di |¤Ž d S 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Ð9Ñ9Ø€L�#ÐÐÑØ€N�CÐÐÑØ#Ð˜Ð#Ð#Ñ#ð(ð (ð (ð (ð (ð (ð (ð (ð (r4   rR   znvidia/parakeet-tdt-0.6b-v3c                   óH   — e Zd ZU dZdZdZee         eedf         z  e	d<   dS )Ú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]   º   sE   € € € € € € ð!ð !ð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Ð 3Ð 3Ð 3Ð 3Ð 3Ø #Ð #Ð #Ð #Ð #Ð #ð €Ð5Ð6Ñ6Ô6Øð?(ð ?(ð ?(ð ?(ð ?(Ð,ñ ?(ô ?(ñ „ñ 7Ô6ð?(ðD €Ð5Ð6Ñ6Ô6Øð((ð ((ð ((ð ((ð ((Ð(ñ ((ô ((ñ „ñ 7Ô6ð((ðV €Ð6Ð7Ñ7Ô7Øð/(ð /(ð /(ð /(ð /(Ð)ñ /(ô /(ñ „ñ 8Ô7ð/(ðd €Ð8Ð9Ñ9Ô9Øð%=ð %=ð %=ð %=ð %=Ð*ñ %=ô %=ñ „ñ :Ô9ð%=ðP dÐ
cÐ
c€€€r4   