§
    Ý˜ºhÌ¤  ã                   óö  — d dl mZ d dlZd dlmZ ddlmZ ej        j	         G d„ de¦  «        ¦   «         Z
ej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d	„ d
e¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         ZeZej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ de¦  «        ¦   «         Zej        j	         G d„ d e¦  «        ¦   «         Zej        j	         G d!„ d"e¦  «        ¦   «         Zej        j	         G d#„ d$e¦  «        ¦   «         Zej        j	         G d%„ d&e¦  «        ¦   «         Zej        j	         G d'„ d(e¦  «        ¦   «         Zej        j	         G d)„ d*e¦  «        ¦   «         ZdS )+é    )ÚOptionalNé   )ÚModelOutputc                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxBaseModelOutputan  
    Base class for model's outputs, with potential hidden states and attentions.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the model.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    NÚlast_hidden_stateÚhidden_statesÚ
attentions)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   ÚjnpÚndarrayÚ__annotations__r	   Útupler
   © ó    új/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/transformers/modeling_flax_outputs.pyr   r      sn   € € € € € € ðð ð& 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   r   c                   óh   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dS )Ú"FlaxBaseModelOutputWithNoAttentionaå  
    Base class for model's outputs, with potential hidden states.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, num_channels, height, width)`):
            Sequence of hidden-states at the output of the last layer of the model.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings, if the model has an embedding layer, + one
            for the output of each layer) of shape `(batch_size, num_channels, height, width)`. Hidden-states of the
            model at the output of each layer plus the optional initial embedding outputs.
    Nr   r	   )r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   0   sR   € € € € € € ð
ð 
ð 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ð6Ð6r   r   c                   óŒ   — e Zd ZU dZdZeej                 ed<   dZ	eej                 ed<   dZ
eeej                          ed<   dS )Ú,FlaxBaseModelOutputWithPoolingAndNoAttentiona£  
    Base class for model's outputs that also contains a pooling of the last hidden states.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, num_channels, height, width)`):
            Sequence of hidden-states at the output of the last layer of the model.
        pooler_output (`jnp.ndarray` of shape `(batch_size, hidden_size)`):
            Last layer hidden-state after a pooling operation on the spatial dimensions.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings, if the model has an embedding layer, + one
            for the output of each layer) of shape `(batch_size, num_channels, height, width)`. Hidden-states of the
            model at the output of each layer plus the optional initial embedding outputs.
    Nr   Úpooler_outputr	   )r   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   B   si   € € € € € € ðð ð 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø+/€M�8˜CœKÔ(Ð/Ð/Ñ/Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ð6Ð6r   r   c                   óh   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dS )Ú(FlaxImageClassifierOutputWithNoAttentionaÈ  
    Base class for outputs of image classification models.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, config.num_labels)`):
            Classification (or regression if config.num_labels==1) scores (before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when
        `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings, if the model has an embedding layer, + one
            for the output of each stage) of shape `(batch_size, num_channels, height, width)`. Hidden-states (also
            called feature maps) of the model at the output of each stage.
    NÚlogitsr	   )r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r   r   W   sQ   € € € € € € ðð ð %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ð6Ð6r   r   c                   óÌ   — e Zd ZU dZdZeej                 ed<   dZ	ee
eej        f                  ed<   dZeeej                          ed<   dZeeej                          ed<   dS )ÚFlaxBaseModelOutputWithPasta’  
    Base class for model's outputs, with potential hidden states and attentions.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the model.
        past_key_values (`dict[str, jnp.ndarray]`):
            Dictionary of pre-computed hidden-states (key and values in the attention blocks) that can be used for fast
            auto-regressive decoding. Pre-computed key and value hidden-states are of shape *[batch_size, max_length]*.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   Úpast_key_valuesr	   r
   )r   r   r   r   r   r   r   r   r   r    ÚdictÚstrr	   r   r
   r   r   r   r   r   j   s�   € € € € € € ðð ð, 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø8<€O�X˜d 3¨¬Ð#3Ô4Ô5Ð<Ð<Ñ<Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   r   c                   ó¼   — e Zd ZU dZdZeej                 ed<   dZ	eej                 ed<   dZ
eeej                          ed<   dZeeej                          ed<   dS )ÚFlaxBaseModelOutputWithPoolingaô  
    Base class for model's outputs that also contains a pooling of the last hidden states.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the model.
        pooler_output (`jnp.ndarray` of shape `(batch_size, hidden_size)`):
            Last layer hidden-state of the first token of the sequence (classification token) further processed by a
            Linear layer and a Tanh activation function. The Linear layer weights are trained from the next sentence
            prediction (classification) objective during pretraining.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r   r	   r
   )r   r   r   r   r   r   r   r   r   r   r	   r   r
   r   r   r   r$   r$   ˆ   s…   € € € € € € ðð ð. 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø+/€M�8˜CœKÔ(Ð/Ð/Ñ/Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   r$   c                   ó(  — e Zd ZU dZdZeej                 ed<   dZ	eej                 ed<   dZ
eeej                          ed<   dZeeeej                                   ed<   dZeeej                          ed<   dZeeej                          ed<   dS )	Ú0FlaxBaseModelOutputWithPoolingAndCrossAttentionsaÞ  
    Base class for model's outputs that also contains a pooling of the last hidden states.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the model.
        pooler_output (`jnp.ndarray` of shape `(batch_size, hidden_size)`):
            Last layer hidden-state of the first token of the sequence (classification token) after further processing
            through the layers used for the auxiliary pretraining task. E.g. for BERT-family of models, this returns
            the classification token after processing through a linear layer and a tanh activation function. The linear
            layer weights are trained from the next sentence prediction (classification) objective during pretraining.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings, if the model has an embedding layer, + one
            for the output of each layer) of shape `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the optional initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` and `config.add_cross_attention=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and optionally if
            `config.is_encoder_decoder=True` 2 additional tensors of shape `(batch_size, num_heads,
            encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
            `config.is_encoder_decoder=True` in the cross-attention blocks) that can be used (see `past_key_values`
            input) to speed up sequential decoding.
    Nr   r   r	   r    r
   Úcross_attentions)r   r   r   r   r   r   r   r   r   r   r	   r   r    r
   r'   r   r   r   r&   r&   §   sÄ   € € € € € € ð%ð %ðN 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø+/€M�8˜CœKÔ(Ð/Ð/Ñ/Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ð9Ð9r   r&   c                   ó  — e Zd ZU dZdZeej                 ed<   dZ	ee
e
ej                                   ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZee
ej                          ed<   dS )Ú-FlaxBaseModelOutputWithPastAndCrossAttentionsa0
  
    Base class for model's outputs that may also contain a past key/values (to speed up sequential decoding).

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the model.

            If `past_key_values` is used only the last hidden-state of the sequences of shape `(batch_size, 1,
            hidden_size)` is output.
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and optionally if
            `config.is_encoder_decoder=True` 2 additional tensors of shape `(batch_size, num_heads,
            encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and optionally if
            `config.is_encoder_decoder=True` in the cross-attention blocks) that can be used (see `past_key_values`
            input) to speed up sequential decoding.
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` and `config.add_cross_attention=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
    Nr   r    r	   r
   r'   )r   r   r   r   r   r   r   r   r   r    r   r	   r
   r'   r   r   r   r)   r)   Ø   s­   € € € € € € ð#ð #ðJ 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ð9Ð9r   r)   c                   óˆ  — e Zd ZU dZdZeej                 ed<   dZ	ee
e
ej                                   ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZeej                 ed<   dZee
ej                          ed	<   dZee
ej                          ed
<   dS )ÚFlaxSeq2SeqModelOutputa/  
    Base class for model encoder's outputs that also contains : pre-computed hidden states that can speed up sequential
    decoding.

    Args:
        last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`):
            Sequence of hidden-states at the output of the last layer of the decoder of the model.

            If `past_key_values` is used only the last hidden-state of the sequences of shape `(batch_size, 1,
            hidden_size)` is output.
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
            `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
            blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
        decoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.
        decoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
        encoder_last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
            Sequence of hidden-states at the output of the last layer of the encoder of the model.
        encoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.
        encoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
    Nr   r    Údecoder_hidden_statesÚdecoder_attentionsr'   Úencoder_last_hidden_stateÚencoder_hidden_statesÚencoder_attentions)r   r   r   r   r   r   r   r   r   r    r   r,   r-   r'   r.   r/   r0   r   r   r   r+   r+     s  € € € € € € ð/ð /ðb 04Ð�x ¤Ô,Ð3Ð3Ñ3Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ø7;Ð˜x¨¬Ô4Ð;Ð;Ñ;Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ð;Ð;r   r+   c                   ó  — e Zd ZU dZdZeej                 ed<   dZ	ee
e
ej                                   ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZee
ej                          ed<   dS )Ú%FlaxCausalLMOutputWithCrossAttentionsa•  
    Base class for causal language model (or autoregressive) outputs.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, sequence_length, config.vocab_size)`):
            Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Cross attentions weights after the attention softmax, used to compute the weighted average in the
            cross-attention heads.
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `jnp.ndarray` tuples of length `config.n_layers`, with each tuple containing the cached key, value
            states of the self-attention and the cross-attention layers if model is used in encoder-decoder setting.
            Only relevant if `config.is_decoder = True`.

            Contains pre-computed hidden-states (key and values in the attention blocks) that can be used (see
            `past_key_values` input) to speed up sequential decoding.
    Nr   r    r	   r
   r'   )r   r   r   r   r   r   r   r   r   r    r   r	   r
   r'   r   r   r   r2   r2   C  s¬   € € € € € € ðð ð@ %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ð9Ð9r   r2   c                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxMaskedLMOutputaf  
    Base class for masked language models outputs.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, sequence_length, config.vocab_size)`):
            Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r	   r
   ©r   r   r   r   r   r   r   r   r   r	   r   r
   r   r   r   r4   r4   l  óm   € € € € € € ðð ð& %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   r4   c                   óˆ  — e Zd ZU dZdZeej                 ed<   dZ	ee
e
ej                                   ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZeej                 ed<   dZee
ej                          ed	<   dZee
ej                          ed
<   dS )ÚFlaxSeq2SeqLMOutputa\  
    Base class for sequence-to-sequence language models outputs.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, sequence_length, config.vocab_size)`):
            Prediction scores of the language modeling head (scores for each vocabulary token before SoftMax).
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
            `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
            blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
        decoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.
        decoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
        encoder_last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
            Sequence of hidden-states at the output of the last layer of the encoder of the model.
        encoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.
        encoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
    Nr   r    r,   r-   r'   r.   r/   r0   ©r   r   r   r   r   r   r   r   r   r    r   r,   r-   r'   r.   r/   r0   r   r   r   r8   r8   ‰  ó   € € € € € € ð+ð +ðZ %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ø7;Ð˜x¨¬Ô4Ð;Ð;Ñ;Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ð;Ð;r   r8   c                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxNextSentencePredictorOutputa�  
    Base class for outputs of models predicting if two sentences are consecutive or not.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, 2)`):
            Prediction scores of the next sequence prediction (classification) head (scores of True/False continuation
            before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r	   r
   r5   r   r   r   r<   r<   Â  sm   € € € € € € ðð ð( %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   r<   c                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxSequenceClassifierOutputaM  
    Base class for outputs of sentence classification models.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, config.num_labels)`):
            Classification (or regression if config.num_labels==1) scores (before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r	   r
   r5   r   r   r   r>   r>   Ý  r6   r   r>   c                   óˆ  — e Zd ZU dZdZeej                 ed<   dZ	ee
e
ej                                   ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZee
ej                          ed<   dZeej                 ed<   dZee
ej                          ed	<   dZee
ej                          ed
<   dS )Ú#FlaxSeq2SeqSequenceClassifierOutputaJ  
    Base class for outputs of sequence-to-sequence sentence classification models.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, config.num_labels)`):
            Classification (or regression if config.num_labels==1) scores (before SoftMax).
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
            `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
            blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
        decoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.
        decoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
        encoder_last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
            Sequence of hidden-states at the output of the last layer of the encoder of the model.
        encoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.
        encoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
    Nr   r    r,   r-   r'   r.   r/   r0   r9   r   r   r   r@   r@   ÷  r:   r   r@   c                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxMultipleChoiceModelOutputay  
    Base class for outputs of multiple choice models.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, num_choices)`):
            *num_choices* is the second dimension of the input tensors. (see *input_ids* above).

            Classification scores (before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r	   r
   r5   r   r   r   rB   rB   0  sm   € € € € € € ðð ð* %)€FˆH�S”[Ô!Ð(Ð(Ñ(Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   rB   c                   ó˜   — e Zd ZU dZdZeej                 ed<   dZ	ee
ej                          ed<   dZee
ej                          ed<   dS )ÚFlaxTokenClassifierOutputa3  
    Base class for outputs of token classification models.

    Args:
        logits (`jnp.ndarray` of shape `(batch_size, sequence_length, config.num_labels)`):
            Classification scores (before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    Nr   r	   r
   r5   r   r   r   rD   rD   L  r6   r   rD   c                   ó¼   — e Zd ZU dZdZeej                 ed<   dZ	eej                 ed<   dZ
eeej                          ed<   dZeeej                          ed<   dS )Ú FlaxQuestionAnsweringModelOutputa›  
    Base class for outputs of question answering models.

    Args:
        start_logits (`jnp.ndarray` of shape `(batch_size, sequence_length)`):
            Span-start scores (before SoftMax).
        end_logits (`jnp.ndarray` of shape `(batch_size, sequence_length)`):
            Span-end scores (before SoftMax).
        hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the model at the output of each layer plus the initial embedding outputs.
        attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights after the attention softmax, used to compute the weighted average in the self-attention
            heads.
    NÚstart_logitsÚ
end_logitsr	   r
   )r   r   r   r   rG   r   r   r   r   rH   r	   r   r
   r   r   r   rF   rF   f  s„   € € € € € € ðð ð* +/€L�(˜3œ;Ô'Ð.Ð.Ñ.Ø(,€J�˜œÔ%Ð,Ð,Ñ,Ø26€M�8˜E #¤+Ô.Ô/Ð6Ð6Ñ6Ø/3€J�˜˜sœ{Ô+Ô,Ð3Ð3Ñ3Ð3Ð3r   rF   c                   ó¬  — e Zd ZU dZdZeej                 ed<   dZ	eej                 ed<   dZ
eeeej                                   ed<   dZeeej                          ed<   dZeeej                          ed<   dZeeej                          ed<   dZeej                 ed	<   dZeeej                          ed
<   dZeeej                          ed<   dS )Ú'FlaxSeq2SeqQuestionAnsweringModelOutputa˜  
    Base class for outputs of sequence-to-sequence question answering models.

    Args:
        start_logits (`jnp.ndarray` of shape `(batch_size, sequence_length)`):
            Span-start scores (before SoftMax).
        end_logits (`jnp.ndarray` of shape `(batch_size, sequence_length)`):
            Span-end scores (before SoftMax).
        past_key_values (`tuple(tuple(jnp.ndarray))`, *optional*, returned when `use_cache=True` is passed or when `config.use_cache=True`):
            Tuple of `tuple(jnp.ndarray)` of length `config.n_layers`, with each tuple having 2 tensors of shape
            `(batch_size, num_heads, sequence_length, embed_size_per_head)`) and 2 additional tensors of shape
            `(batch_size, num_heads, encoder_sequence_length, embed_size_per_head)`.

            Contains pre-computed hidden-states (key and values in the self-attention blocks and in the cross-attention
            blocks) that can be used (see `past_key_values` input) to speed up sequential decoding.
        decoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the decoder at the output of each layer plus the initial embedding outputs.
        decoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
        cross_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the decoder's cross-attention layer, after the attention softmax, used to compute the
            weighted average in the cross-attention heads.
        encoder_last_hidden_state (`jnp.ndarray` of shape `(batch_size, sequence_length, hidden_size)`, *optional*):
            Sequence of hidden-states at the output of the last layer of the encoder of the model.
        encoder_hidden_states (`tuple(jnp.ndarray)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `jnp.ndarray` (one for the output of the embeddings + one for the output of each layer) of shape
            `(batch_size, sequence_length, hidden_size)`.

            Hidden-states of the encoder at the output of each layer plus the initial embedding outputs.
        encoder_attentions (`tuple(jnp.ndarray)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `jnp.ndarray` (one for each layer) of shape `(batch_size, num_heads, sequence_length,
            sequence_length)`.

            Attentions weights of the encoder, after the attention softmax, used to compute the weighted average in the
            self-attention heads.
    NrG   rH   r    r,   r-   r'   r.   r/   r0   )r   r   r   r   rG   r   r   r   r   rH   r    r   r,   r-   r'   r.   r/   r0   r   r   r   rJ   rJ   ƒ  s  € € € € € € ð-ð -ð^ +/€L�(˜3œ;Ô'Ð.Ð.Ñ.Ø(,€J�˜œÔ%Ð,Ð,Ñ,Ø;?€O�X˜e E¨#¬+Ô$6Ô7Ô8Ð?Ð?Ñ?Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ø59Ð�h˜u S¤[Ô1Ô2Ð9Ð9Ñ9Ø7;Ð˜x¨¬Ô4Ð;Ð;Ñ;Ø:>Ð˜8 E¨#¬+Ô$6Ô7Ð>Ð>Ñ>Ø7;Ð˜  s¤{Ô!3Ô4Ð;Ð;Ñ;Ð;Ð;r   rJ   )Útypingr   ÚflaxÚ	jax.numpyÚnumpyr   Úutilsr   ÚstructÚ	dataclassr   r   r   r   r   r$   r&   r)   r+   r2   r4   ÚFlaxCausalLMOutputr8   r<   r>   r@   rB   rD   rF   rJ   r   r   r   ú<module>rS      sÒ  ðð Ð Ð Ð Ð Ð à €€€Ø Ð Ð Ð Ð Ð à Ð Ð Ð Ð Ð ð „Ôð4ð 4ð 4ð 4ð 4˜+ñ 4ô 4ñ Ôð4ð2 „Ôð7ð 7ð 7ð 7ð 7¨ñ 7ô 7ñ Ôð7ð" „Ôð7ð 7ð 7ð 7ð 7°;ñ 7ô 7ñ Ôð7ð( „Ôð7ð 7ð 7ð 7ð 7¨{ñ 7ô 7ñ Ôð7ð$ „Ôð4ð 4ð 4ð 4ð 4 +ñ 4ô 4ñ Ôð4ð: „Ôð4ð 4ð 4ð 4ð 4 [ñ 4ô 4ñ Ôð4ð< „Ôð-:ð -:ð -:ð -:ð -:°{ñ -:ô -:ñ Ôð-:ð` „Ôð*:ð *:ð *:ð *:ð *:°Kñ *:ô *:ñ Ôð*:ðZ „Ôð9<ð 9<ð 9<ð 9<ð 9<˜[ñ 9<ô 9<ñ Ôð9<ðx „Ôð%:ð %:ð %:ð %:ð %:¨Kñ %:ô %:ñ Ôð%:ðP „Ôð4ð 4ð 4ð 4ð 4˜ñ 4ô 4ñ Ôð4ð2 (Ð ð „Ôð5<ð 5<ð 5<ð 5<ð 5<˜+ñ 5<ô 5<ñ Ôð5<ðp „Ôð4ð 4ð 4ð 4ð 4 kñ 4ô 4ñ Ôð4ð4 „Ôð4ð 4ð 4ð 4ð 4 ;ñ 4ô 4ñ Ôð4ð2 „Ôð5<ð 5<ð 5<ð 5<ð 5<¨+ñ 5<ô 5<ñ Ôð5<ðp „Ôð4ð 4ð 4ð 4ð 4 Kñ 4ô 4ñ Ôð4ð6 „Ôð4ð 4ð 4ð 4ð 4 ñ 4ô 4ñ Ôð4ð2 „Ôð4ð 4ð 4ð 4ð 4 {ñ 4ô 4ñ Ôð4ð8 „Ôð8<ð 8<ð 8<ð 8<ð 8<¨kñ 8<ô 8<ñ Ôð8<ð 8<ð 8<r   