Ë
    ÛÓ^jßX  ã                   óP  — d Z ddlZddlmZmZmZ ddlmZmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZmZ ddlmZ d	d
lmZmZmZmZmZmZmZmZ  G d„ de«      Z G d„ de«      Z G d„ de«      Z  G d„ de«      Z! G d„ de«      Z" G d„ de«      Z# G d„ de«      Z$ G d„ de«      Z%g d¢Z&y)zPyTorch CamemBERT model.é    N)ÚBCEWithLogitsLossÚCrossEntropyLossÚMSELossé   )Ú,BaseModelOutputWithPoolingAndCrossAttentionsÚ!CausalLMOutputWithCrossAttentionsÚMaskedLMOutputÚMultipleChoiceModelOutputÚQuestionAnsweringModelOutputÚSequenceClassifierOutputÚTokenClassifierOutput)ÚUnpack)ÚTransformersKwargsÚauto_docstring)Úcan_return_tupleé   )ÚRobertaForCausalLMÚRobertaForMaskedLMÚRobertaForMultipleChoiceÚRobertaForQuestionAnsweringÚ RobertaForSequenceClassificationÚRobertaForTokenClassificationÚRobertaModelÚRobertaPreTrainedModelc                   ó   — e Zd ZdZy)ÚCamembertPreTrainedModelÚrobertaN)Ú__name__Ú
__module__Ú__qualname__Úbase_model_prefix© ó    úz/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/transformers/models/camembert/modular_camembert.pyr   r   ,   s   „ Ø!Ñr#   r   c                   ó   — e Zd Zy)ÚCamembertModelN)r   r   r    r"   r#   r$   r&   r&   0   s   „ Ør#   r&   c                   ót  ‡ — e Zd ZdddœZˆ fd„Zee	 	 	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  d	ej                  dz  d
ej                  dz  dej                  dz  dej                  dz  dej                  dz  de
e   deej                     ez  fd„«       «       Zˆ xZS )ÚCamembertForMaskedLMú)roberta.embeddings.word_embeddings.weightúlm_head.bias©zlm_head.decoder.weightzlm_head.decoder.biasc                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y ©NF©Úadd_pooling_layer©ÚsuperÚ__init__Ú	camembertr&   r   ©ÚselfÚconfigÚ	__class__s     €r$   r2   zCamembertForMaskedLM.__init__:   ó#   ø€ Ü‰Ñ˜Ô ØˆNä% fÀÔFˆ�r#   NÚ	input_idsÚattention_maskÚtoken_type_idsÚposition_idsÚinputs_embedsÚencoder_hidden_statesÚencoder_attention_maskÚlabelsÚkwargsÚreturnc	                 ót  —  | j                   |f||||||ddœ|	¤Ž}
|
d   }| j                  |«      }d}|�a|j                  |j                  «      }t	        «       } ||j                  d| j                  j                  «      |j                  d«      «      }t        |||
j                  |
j                  ¬«      S )aô  
        token_type_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Labels for computing the masked language modeling loss. Indices should be in `[-100, 0, ...,
            config.vocab_size]` (see `input_ids` docstring) Tokens with indices set to `-100` are ignored (masked), the
            loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`
        T)r:   r;   r<   r=   r>   r?   Úreturn_dictr   Néÿÿÿÿ©ÚlossÚlogitsÚhidden_statesÚ
attentions)r   Úlm_headÚtoÚdevicer   Úviewr6   Ú
vocab_sizer	   rI   rJ   )r5   r9   r:   r;   r<   r=   r>   r?   r@   rA   ÚoutputsÚsequence_outputÚprediction_scoresÚmasked_lm_lossÚloss_fcts                  r$   ÚforwardzCamembertForMaskedLM.forward@   sÓ   € ð: �$—,‘,Øð

à)Ø)Ø%Ø'Ø"7Ø#9Øñ

ð ñ

ˆð " !™*ˆØ ŸL™L¨Ó9ÐàˆØÐà—Y‘YÐ0×7Ñ7Ó8ˆFÜ'Ó)ˆHÙ%Ð&7×&<Ñ&<¸RÀÇÁ×AWÑAWÓ&XÐZ`×ZeÑZeÐfhÓZiÓjˆNäØØ$Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
r#   )NNNNNNNN)r   r   r    Ú_tied_weights_keysr2   r   r   ÚtorchÚ
LongTensorÚFloatTensorr   r   ÚtupleÚTensorr	   rU   Ú__classcell__©r7   s   @r$   r(   r(   4   s  ø„ à"MØ .ñÐô
Gð Øð .2Ø37Ø26Ø04Ø26Ø:>Ø;?Ø*.ñ5
à×#Ñ# dÑ*ð5
ð ×)Ñ)¨DÑ0ð5
ð ×(Ñ(¨4Ñ/ð	5
ð
 ×&Ñ&¨Ñ-ð5
ð ×(Ñ(¨4Ñ/ð5
ð  %×0Ñ0°4Ñ7ð5
ð !&× 1Ñ 1°DÑ 8ð5
ð × Ñ  4Ñ'ð5
ð Ð+Ñ,ð5
ð 
ˆu�|‰|Ñ	˜~Ñ	-ò5
ó ó ô5
r#   r(   c                   ó*  ‡ — e Zd Zˆ fd„Zee	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  d	e	e
   d
eej                     ez  fd„«       «       Zˆ xZS )Ú"CamembertForSequenceClassificationc                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y r-   r0   r4   s     €r$   r2   z+CamembertForSequenceClassification.__init__{   r8   r#   Nr9   r:   r;   r<   r=   r@   rA   rB   c           	      óô  —  | j                   |f||||ddœ|¤Ž}|d   }	| j                  |	«      }
d}|��¢|j                  |
j                  «      }| j                  j
                  €�| j                  dk(  rd| j                  _        nl| j                  dkD  rL|j                  t        j                  k(  s|j                  t        j                  k(  rd| j                  _        nd| j                  _        | j                  j
                  dk(  rIt        «       }| j                  dk(  r& ||
j                  «       |j                  «       «      }nŒ ||
|«      }n‚| j                  j
                  dk(  r=t        «       } ||
j                  d	| j                  «      |j                  d	«      «      }n,| j                  j
                  dk(  rt        «       } ||
|«      }t!        ||
|j"                  |j$                  ¬
«      S )aß  
        token_type_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
            Labels for computing the sequence classification/regression loss. Indices should be in `[0, ...,
            config.num_labels - 1]`. If `config.num_labels == 1` a regression loss is computed (Mean-Square loss), If
            `config.num_labels > 1` a classification loss is computed (Cross-Entropy).
        T©r:   r;   r<   r=   rD   r   Né   Ú
regressionÚsingle_label_classificationÚmulti_label_classificationrE   rF   )r   Ú
classifierrL   rM   r6   Úproblem_typeÚ
num_labelsÚdtyperW   ÚlongÚintr   Úsqueezer   rN   r   r   rI   rJ   ©r5   r9   r:   r;   r<   r=   r@   rA   rP   rQ   rH   rG   rT   s                r$   rU   z*CamembertForSequenceClassification.forward�   s­  € ð6 �$—,‘,Øð
à)Ø)Ø%Ø'Øñ
ð ñ
ˆð " !™*ˆØ—‘ Ó1ˆàˆØÑà—Y‘Y˜vŸ}™}Ó-ˆFØ�{‰{×'Ñ'Ð/Ø—?‘? aÒ'Ø/;�D—K‘KÕ,Ø—_‘_ qÒ(¨f¯l©l¼e¿j¹jÒ.HÈFÏLÉLÔ\a×\eÑ\eÒLeØ/L�D—K‘KÕ,à/K�D—K‘KÔ,à�{‰{×'Ñ'¨<Ò7Ü"›9�Ø—?‘? aÒ'Ù# F§N¡NÓ$4°f·n±nÓ6FÓG‘Dá# F¨FÓ3‘DØ—‘×)Ñ)Ð-JÒJÜ+Ó-�Ù §¡¨B°·±Ó @À&Ç+Á+ÈbÃ/ÓR‘Ø—‘×)Ñ)Ð-IÒIÜ,Ó.�Ù ¨Ó/�ä'ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
r#   ©NNNNNN)r   r   r    r2   r   r   rW   rX   rY   r   r   rZ   r[   r   rU   r\   r]   s   @r$   r_   r_   z   sè   ø„ ôGð Øð .2Ø37Ø26Ø04Ø26Ø*.ñC
à×#Ñ# dÑ*ðC
ð ×)Ñ)¨DÑ0ðC
ð ×(Ñ(¨4Ñ/ð	C
ð
 ×&Ñ&¨Ñ-ðC
ð ×(Ñ(¨4Ñ/ðC
ð × Ñ  4Ñ'ðC
ð Ð+Ñ,ðC
ð 
ˆu�|‰|Ñ	Ð7Ñ	7òC
ó ó ôC
r#   r_   c                   ó*  ‡ — e Zd Zˆ fd„Zee	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  d	e	e
   d
eej                     ez  fd„«       «       Zˆ xZS )ÚCamembertForMultipleChoicec                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y )NTr.   r0   r4   s     €r$   r2   z#CamembertForMultipleChoice.__init__Ê   s#   ø€ Ü‰Ñ˜Ô ØˆNä% fÀÔEˆ�r#   Nr9   r;   r:   r@   r<   r=   rA   rB   c           	      ó"  — |�|j                   d   n|j                   d   }|�!|j                  d|j                  d«      «      nd}	|�!|j                  d|j                  d«      «      nd}
|�!|j                  d|j                  d«      «      nd}|�!|j                  d|j                  d«      «      nd}|�1|j                  d|j                  d«      |j                  d«      «      nd} | j                  |	f|
|||ddœ|¤Ž}|d   }| j	                  |«      }| j                  |«      }|j                  d|«      }d}|�.|j                  |j                  «      }t        «       } |||«      }t        |||j                  |j                  ¬«      S )a  
        input_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`):
            Indices of input sequence tokens in the vocabulary.

            Indices can be obtained using [`AutoTokenizer`]. See [`PreTrainedTokenizer.encode`] and
            [`PreTrainedTokenizer.__call__`] for details.

            [What are input IDs?](../glossary#input-ids)
        token_type_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        labels (`torch.LongTensor` of shape `(batch_size,)`, *optional*):
            Labels for computing the multiple choice classification loss. Indices should be in `[0, ...,
            num_choices-1]` where `num_choices` is the size of the second dimension of the input tensors. (See
            `input_ids` above)
        position_ids (`torch.LongTensor` of shape `(batch_size, num_choices, sequence_length)`, *optional*):
            Indices of positions of each input sequence tokens in the position embeddings. Selected in the range `[0,
            config.max_position_embeddings - 1]`.

            [What are position IDs?](../glossary#position-ids)
        inputs_embeds (`torch.FloatTensor` of shape `(batch_size, num_choices, sequence_length, hidden_size)`, *optional*):
            Optionally, instead of passing `input_ids` you can choose to directly pass an embedded representation. This
            is useful if you want more control over how to convert `input_ids` indices into associated vectors than the
            model's internal embedding lookup matrix.
        Nrc   rE   éþÿÿÿT)r<   r;   r:   r=   rD   rF   )ÚshaperN   Úsizer   Údropoutrg   rL   rM   r   r
   rI   rJ   )r5   r9   r;   r:   r@   r<   r=   rA   Únum_choicesÚflat_input_idsÚflat_position_idsÚflat_token_type_idsÚflat_attention_maskÚflat_inputs_embedsrP   Úpooled_outputrH   Úreshaped_logitsrG   rT   s                       r$   rU   z"CamembertForMultipleChoice.forwardÐ   sµ  € ðV -6Ð,A�i—o‘o aÒ(À}×GZÑGZÐ[\ÑG]ˆàCLÐCX˜Ÿ™¨¨I¯N©N¸2Ó,>Ô?Ð^bˆØLXÐLd˜L×-Ñ-¨b°,×2CÑ2CÀBÓ2GÔHÐjnÐØR`ÐRl˜n×1Ñ1°"°n×6IÑ6IÈ"Ó6MÔNÐrvÐØR`ÐRl˜n×1Ñ1°"°n×6IÑ6IÈ"Ó6MÔNÐrvÐð Ð(ð ×Ñ˜r =×#5Ñ#5°bÓ#9¸=×;MÑ;MÈbÓ;QÔRàð 	ð �$—,‘,Øð
à*Ø.Ø.Ø,Øñ
ð ñ
ˆð   ™
ˆàŸ™ ]Ó3ˆØ—‘ Ó/ˆØ Ÿ+™+ b¨+Ó6ˆàˆØÐà—Y‘Y˜×5Ñ5Ó6ˆFÜ'Ó)ˆHÙ˜O¨VÓ4ˆDä(ØØ"Ø!×/Ñ/Ø×)Ñ)ô	
ð 	
r#   ro   )r   r   r    r2   r   r   rW   rX   rY   r   r   rZ   r[   r
   rU   r\   r]   s   @r$   rq   rq   É   sè   ø„ ôFð Øð .2Ø26Ø37Ø*.Ø04Ø26ñP
à×#Ñ# dÑ*ðP
ð ×(Ñ(¨4Ñ/ðP
ð ×)Ñ)¨DÑ0ð	P
ð
 × Ñ  4Ñ'ðP
ð ×&Ñ&¨Ñ-ðP
ð ×(Ñ(¨4Ñ/ðP
ð Ð+Ñ,ðP
ð 
ˆu�|‰|Ñ	Ð8Ñ	8òP
ó ó ôP
r#   rq   c                   ó*  ‡ — e Zd Zˆ fd„Zee	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  d	e	e
   d
eej                     ez  fd„«       «       Zˆ xZS )ÚCamembertForTokenClassificationc                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y r-   r0   r4   s     €r$   r2   z(CamembertForTokenClassification.__init__&  r8   r#   Nr9   r:   r;   r<   r=   r@   rA   rB   c           	      ó~  —  | j                   |f||||ddœ|¤Ž}|d   }	| j                  |	«      }	| j                  |	«      }
d}|�W|j                  |
j                  «      }t        «       } ||
j                  d| j                  «      |j                  d«      «      }t        ||
|j                  |j                  ¬«      S )a-  
        token_type_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Labels for computing the token classification loss. Indices should be in `[0, ..., config.num_labels - 1]`.
        Trb   r   NrE   rF   )r   rw   rg   rL   rM   r   rN   ri   r   rI   rJ   rn   s                r$   rU   z'CamembertForTokenClassification.forward,  sÉ   € ð2 �$—,‘,Øð
à)Ø)Ø%Ø'Øñ
ð ñ
ˆð " !™*ˆàŸ,™, Ó7ˆØ—‘ Ó1ˆàˆØÐà—Y‘Y˜vŸ}™}Ó-ˆFÜ'Ó)ˆHÙ˜FŸK™K¨¨D¯O©OÓ<¸f¿k¹kÈ"»oÓNˆDä$ØØØ!×/Ñ/Ø×)Ñ)ô	
ð 	
r#   ro   )r   r   r    r2   r   r   rW   rX   rY   r   r   rZ   r[   r   rU   r\   r]   s   @r$   r�   r�   %  sÞ   ø„ ôGð Øð .2Ø37Ø26Ø04Ø26Ø*.ñ2
à×#Ñ# dÑ*ð2
ð ×)Ñ)¨DÑ0ð2
ð ×(Ñ(¨4Ñ/ð	2
ð
 ×&Ñ&¨Ñ-ð2
ð ×(Ñ(¨4Ñ/ð2
ð × Ñ  4Ñ'ð2
ð Ð+Ñ,ð2
ð 
ˆu�|‰|Ñ	Ð4Ñ	4ò2
ó ó ô2
r#   r�   c                   óJ  ‡ — e Zd Zˆ fd„Zee	 	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  dej                  dz  d	ej                  dz  d
e	e
   deej                     ez  fd„«       «       Zˆ xZS )ÚCamembertForQuestionAnsweringc                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y r-   r0   r4   s     €r$   r2   z&CamembertForQuestionAnswering.__init__d  r8   r#   Nr9   r:   r;   r<   r=   Ústart_positionsÚend_positionsrA   rB   c           	      óÆ  —  | j                   |f||||ddœ|¤Ž}	|	d   }
| j                  |
«      }|j                  dd¬«      \  }}|j                  d«      j	                  «       }|j                  d«      j	                  «       }d}|�·|�µt        |j                  «       «      dkD  r|j                  d«      }t        |j                  «       «      dkD  r|j                  d«      }|j                  d«      }|j                  d|«      }|j                  d|«      }t        |¬«      } |||«      } |||«      }||z   d	z  }t        ||||	j                  |	j                  ¬
«      S )a[  
        token_type_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        Trb   r   rc   rE   )ÚdimN)Úignore_indexr   )rG   Ústart_logitsÚ
end_logitsrI   rJ   )r   Ú
qa_outputsÚsplitrm   Ú
contiguousÚlenrv   Úclampr   r   rI   rJ   )r5   r9   r:   r;   r<   r=   r‡   rˆ   rA   rP   rQ   rH   rŒ   r�   Ú
total_lossÚignored_indexrT   Ú
start_lossÚend_losss                      r$   rU   z%CamembertForQuestionAnswering.forwardj  s€  € ð0 �$—,‘,Øð
à)Ø)Ø%Ø'Øñ
ð ñ
ˆð " !™*ˆà—‘ Ó1ˆØ#)§<¡<°°r <Ó#:Ñ ˆ�jØ#×+Ñ+¨BÓ/×:Ñ:Ó<ˆØ×'Ñ'¨Ó+×6Ñ6Ó8ˆ
àˆ
ØÐ&¨=Ð+Dä�?×'Ñ'Ó)Ó*¨QÒ.Ø"1×"9Ñ"9¸"Ó"=�Ü�=×%Ñ%Ó'Ó(¨1Ò,Ø -× 5Ñ 5°bÓ 9�à(×-Ñ-¨aÓ0ˆMØ-×3Ñ3°A°}ÓEˆOØ)×/Ñ/°°=ÓAˆMä'°]ÔCˆHÙ! ,°Ó@ˆJÙ 
¨MÓ:ˆHØ$ xÑ/°1Ñ4ˆJä+ØØ%Ø!Ø!×/Ñ/Ø×)Ñ)ô
ð 	
r#   )NNNNNNN)r   r   r    r2   r   r   rW   rX   rY   r   r   rZ   r[   r   rU   r\   r]   s   @r$   r…   r…   c  sö   ø„ ôGð Øð .2Ø37Ø26Ø04Ø26Ø37Ø15ñ>
à×#Ñ# dÑ*ð>
ð ×)Ñ)¨DÑ0ð>
ð ×(Ñ(¨4Ñ/ð	>
ð
 ×&Ñ&¨Ñ-ð>
ð ×(Ñ(¨4Ñ/ð>
ð ×)Ñ)¨DÑ0ð>
ð ×'Ñ'¨$Ñ.ð>
ð Ð+Ñ,ð>
ð 
ˆu�|‰|Ñ	Ð;Ñ	;ò>
ó ó ô>
r#   r…   c                   óÌ  ‡ — e Zd ZdddœZˆ fd„Zee	 	 	 	 	 	 	 	 	 	 	 ddej                  dz  dej                  dz  dej                  dz  d	ej                  dz  d
ej                  dz  dej                  dz  dej                  dz  dej                  dz  de
e
ej                        dz  dedz  deej                  z  dee   de
ej                     ez  fd„«       «       Zˆ xZS )ÚCamembertForCausalLMr)   r*   r+   c                 óL   •— t         ‰| �  |«       | `t        |d¬«      | _        y r-   r0   r4   s     €r$   r2   zCamembertForCausalLM.__init__³  r8   r#   Nr9   r:   r;   r<   r=   r>   r?   r@   Úpast_key_valuesÚ	use_cacheÚlogits_to_keeprA   rB   c                 óž  — |�d}
 | j                   |f|||||||	|
ddœ	|¤Ž}|j                  }t        |t        «      rt	        | d«      n|}| j                  |dd…|dd…f   «      }d}|�* | j                  d||| j                  j                  dœ|¤Ž}t        |||j                  |j                  |j                  |j                  ¬«      S )aq  
        token_type_ids (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Segment token indices to indicate first and second portions of the inputs. Indices are selected in `[0,1]`:

            - 0 corresponds to a *sentence A* token,
            - 1 corresponds to a *sentence B* token.
            This parameter can only be used when the model is initialized with `type_vocab_size` parameter with value
            >= 2. All the value in this tensor should be always < type_vocab_size.

            [What are token type IDs?](../glossary#token-type-ids)
        labels (`torch.LongTensor` of shape `(batch_size, sequence_length)`, *optional*):
            Labels for computing the left-to-right language modeling loss (next word prediction). Indices should be in
            `[-100, 0, ..., config.vocab_size]` (see `input_ids` docstring) Tokens with indices set to `-100` are
            ignored (masked), the loss is only computed for the tokens with labels in `[0, ..., config.vocab_size]`

        Example:

        ```python
        >>> from transformers import AutoTokenizer, CamembertForCausalLM, AutoConfig
        >>> import torch

        >>> tokenizer = AutoTokenizer.from_pretrained("almanach/camembert-base")
        >>> config = AutoConfig.from_pretrained("almanach/camembert-base")
        >>> config.is_decoder = True
        >>> model = CamembertForCausalLM.from_pretrained("almanach/camembert-base", config=config)

        >>> inputs = tokenizer("Hello, my dog is cute", return_tensors="pt")
        >>> outputs = model(**inputs)

        >>> prediction_logits = outputs.logits
        ```NFT)	r:   r;   r<   r=   r>   r?   rš   r›   rD   )rH   r@   rO   )rG   rH   rš   rI   rJ   Úcross_attentionsr"   )r   Úlast_hidden_stateÚ
isinstancerl   ÚslicerK   Úloss_functionr6   rO   r   rš   rI   rJ   rž   )r5   r9   r:   r;   r<   r=   r>   r?   r@   rš   r›   rœ   rA   rP   rI   Úslice_indicesrH   rG   s                     r$   rU   zCamembertForCausalLM.forward¹  sý   € ð` ÐØˆIà@LÀÇÁØðA
à)Ø)Ø%Ø'Ø"7Ø#9Ø+ØØñA
ð ñA
ˆð  ×1Ñ1ˆä8BÀ>ÔSVÔ8Wœ˜~˜o¨tÔ4Ð]kˆØ—‘˜mªA¨}ºaÐ,?Ñ@ÓAˆàˆØÐØ%�4×%Ñ%Ðp¨V¸FÈtÏ{É{×OeÑOeÑpÐioÑpˆDä0ØØØ#×3Ñ3Ø!×/Ñ/Ø×)Ñ)Ø$×5Ñ5ô
ð 	
r#   )NNNNNNNNNNr   )r   r   r    rV   r2   r   r   rW   rX   rY   rZ   Úboolrl   r[   r   r   r   rU   r\   r]   s   @r$   r˜   r˜   ­  st  ø„ à"MØ .ñÐô
Gð Øð .2Ø37Ø26Ø04Ø26Ø:>Ø;?Ø*.ØBFØ!%Ø-.ñO
à×#Ñ# dÑ*ðO
ð ×)Ñ)¨DÑ0ðO
ð ×(Ñ(¨4Ñ/ð	O
ð
 ×&Ñ&¨Ñ-ðO
ð ×(Ñ(¨4Ñ/ðO
ð  %×0Ñ0°4Ñ7ðO
ð !&× 1Ñ 1°DÑ 8ðO
ð × Ñ  4Ñ'ðO
ð ˜u U×%6Ñ%6Ñ7Ñ8¸4Ñ?ðO
ð ˜$‘;ðO
ð ˜eŸl™lÑ*ðO
ð Ð+Ñ,ðO
ð 
ˆu�|‰|Ñ	Ð@Ñ	@òO
ó ó ôO
r#   r˜   )r˜   r(   rq   r…   r_   r�   r&   r   )'Ú__doc__rW   Útorch.nnr   r   r   Úmodeling_outputsr   r   r	   r
   r   r   r   Úprocessing_utilsr   Úutilsr   r   Úutils.genericr   Úroberta.modeling_robertar   r   r   r   r   r   r   r   r   r&   r(   r_   rq   r�   r…   r˜   Ú__all__r"   r#   r$   ú<module>r­      sº   ðñ ã ß AÑ A÷÷ ñ õ 'ß 7Ý -÷	÷ 	ó 	ô"Ð5ô "ô	�\ô 	ôC
Ð-ô C
ôLL
Ð)Iô L
ô^Y
Ð!9ô Y
ôx;
Ð&Cô ;
ô|G
Ð$?ô G
ôT]
Ð-ô ]
ò@	�r#   