
    eThs                     R   S SK r S SKJr  S SKrS SKJr  SSKJr  \" 5       (       a  S SKJ	r	J
r
Jr  S SKJrJr   " S S	\R                  R                   5      r " S
 S\R                  R                   5      r " S S\R                  R                   5      r    SS\
S\\R(                     S\\R(                     S\\   S\\   4
S jjr " S S\R                  R                   5      r " S S\R                  R                   5      r " S S\R                  R                   5      rg)    N)Optional)GenerationConfig   )is_torch_available)HybridCachePreTrainedModelStaticCache)is_torch_greater_or_equal"is_torch_greater_or_equal_than_2_3c                     ^  \ rS rSrSr  SS\S\S\4U 4S jjjrS\R                  S\R                  S	\R                  4S
 jr
    SS\\R                     S\\R                     S\\   S\\   S	\R                  R                  4
S jjr\      SS\R                  R                  S\S\S\S\S\S\S\S	\4S jj5       rSrU =r$ )%TorchExportableModuleForDecoderOnlyLM   z
A recipe module designed to make a `PreTrainedModel` exportable with `torch.export`,
specifically for decoder-only LM with cache. This module ensures that the
exported model is compatible with further lowering and execution in `ExecuTorch`.
modelmax_batch_sizemax_cache_lenc                   > [         TU ]  5         [        UR                  S5      (       a  UR                  R                  SL a  [        S5      e[        UR                  S5      (       d'  [        R                  " S5        [        U5      U l	        g	UR                  R                  S:X  a  [        XU5      U l	        g	[        SUR                  R                   S35      e)
aT  
Initializes the exportable module with `HybridCache`.

Args:
    model (`PreTrainedModel`): The pretrained model to wrap.
    max_batch_size (int): Maximum batch size for the cache.
    max_cache_len (int): Maximum sequence length for the cache.

Raises:
    ValueError: If the model is configured with a unsupported cache implementation.
	use_cacheFz5The model must have caching enabled to be performant.cache_implementationzXUsing `StaticCache` for export as `cache_implementation` is not specified in the config.hybridz"Unsupported cache implementation: z". Please use `hybrid` or `static`.N)super__init__hasattrconfigr   
ValueErrorlogginginfo$TorchExportableModuleWithStaticCacher   r   $TorchExportableModuleWithHybridCache)selfr   r   r   	__class__s       \/var/www/auris/envauris/lib/python3.13/site-packages/transformers/integrations/executorch.pyr   .TorchExportableModuleForDecoderOnlyLM.__init__#   s    " 	u||[11U\\5K5Ku5TTUUu||%;<< LLst=eDDJ||00H<A%Yfg
 89Z9Z8[ \7 7     	input_idscache_positionreturnc                 8    U R                   R                  X5      $ )J  
Forward pass of the module, which is compatible with the ExecuTorch llm runner.

Args:
    input_ids (`torch.Tensor`): Tensor representing current input token id to the module.
    cache_position (`torch.Tensor`): Tensor representing current input position in the cache.

Returns:
    torch.Tensor: Logits output from the model.
)r   forward)r   r$   r%   s      r!   r)   -TorchExportableModuleForDecoderOnlyLM.forwardG   s     zz!!)<<r#   dynamic_shapesstrictc                    Ub  UO$[         R                  " S//[         R                  S9nUb  UO#[         R                  " S/[         R                  S9n[         R                  R                  U R                  XV40 UUb  US9$ SS9$ )a.  
Export the wrapped module using `torch.export`.

Args:
    input_ids (`Optional[torch.Tensor]`):
        Tensor representing current input token id to the module. If not provided, a default tensor will be used.
    cache_position (`Optional[torch.Tensor]`):
        Tensor representing current input position in the cache. If not provided, a default tensor will be used.
    dynamic_shapes (`Optional[dict]`):
        Dynamic shapes to use for export if specified.
    strict(`Optional[bool]`):
        Flag to instruct `torch.export` to use `torchdynamo`.
   dtyper   Targskwargsr+   r,   )torchtensorlongexportr   )r   r$   r%   r+   r,   example_input_idsexample_cache_positions          r!   r7   ,TorchExportableModuleForDecoderOnlyLM.exportX   s    ( *3)>IELLSTRUQV^c^h^hDi3A3MSXS_S_ab`ckpkukuSv||""JJ#<)#/6 # 
 	

 6: # 
 	
r#   exported_programpromptmax_new_tokens	do_sampletemperaturetop_ktop_pdevicec	                    U R                  5       n	U" USS9R                  R                  U5      n
U
R                  5       nSn[	        U
R
                  S   5       HB  nU
SS2XS-   24   n[        R                  " U/[        R                  US9nU	" X5      nUS-  nMD     [	        U5       GH  nUSS2SS24   n[        R                  " U/[        R                  US9nU	" X5      nU(       a  US:  a  UU-  nOUnUS:  a.  U[        R                  " UU5      S   S   :  n[        S	5      UU'   US
:  a  [        R                  " USS9u  nn[        R                  " [        R                  " USS9SS9nUU:  nUSSS24   R                  5       USSS24'   SUS'   UR                  SUU5      n[        S	5      UU'   [        R                  " USS9n[        R                  " USS9nOUR!                  SSS9nUR#                  5       S:  a  UR%                  S5      n[        R&                  " UU/SS9nUS-  nUR)                  5       UR*                  :X  d  GM    O   UR-                  US   SS9$ )a  
Generate a sequence of tokens using an exported program.

Args:
    exported_program (`torch.export.ExportedProgram`): The exported model being used for generate.
    tokenizer: The tokenizer to use.
    prompt (str): The input prompt.
    max_new_tokens (int): Maximum number of new tokens to generate.
    do_sample (bool): Whether to use sampling or greedy decoding.
    temperature (float): The temperature for sampling.
    top_k (int): The number of highest probability tokens to keep for top-k sampling.
    top_p (float): The cumulative probability for nucleus sampling.
    device (str): The device to use.

Returns:
    str: The generated text.
pt)return_tensorsr   r.   Nr0   rB   ).rG   Nz-inf      ?T)
descendingdim.).r   )num_samples)rK   keepdimr   )skip_special_tokens)moduler$   toclonerangeshaper4   r5   r6   topkfloatsortcumsumsoftmaxscattermultinomialargmaxrK   squeezecatitemeos_token_iddecode)r;   	tokenizerr<   r=   r>   r?   r@   rA   rB   exported_moduler$   generated_idscurr_positionicurr_input_idscurr_cache_position_outputslogitsindices_to_removesorted_logitssorted_indicescumulative_probssorted_indices_to_removeprobsnext_token_ids                             r!   generate.TorchExportableModuleForDecoderOnlyLM.generatew   s   < +113 fT:DDGGO	 ") yq)*A&q!!e)|4N"',,ejjY_"`  DAQM + ~&A*1bc62N"',,ejjY_"` &nJG ?${2F$F 19(.FE1J11Mm1\(\%05fF,- 3;49JJvRV4W1M>',||EMM-UW4X^`'a$ 0@%/G,8PQTVYWYVYQY8Z8`8`8b,S!"W578,V4 )A(H(H^]u(v%05fF,- f"5 % 1 1%Q G !(2t D   "Q& - 5 5b 9 "II}m&D"MMQM !!#y'='==k 'p a 0dKKr#   )r   r.      NNNN)   FrH   2   rH   cpu)__name__
__module____qualname____firstlineno____doc__r   intr   r4   Tensorr)   r   dictboolr7   ExportedProgramstaticmethodstrrU   rr   __static_attributes____classcell__r    s   @r!   r   r      sk     !	"" " 	" "H=<<= = 
	=& -115)-!%
ELL)
 !.
 !	

 
 
	%	%
> 
 ! iL,,66iL iL 	iL
 iL iL iL iL iL 
iL iLr#   r   c            	          ^  \ rS rSrSrS\4U 4S jjrS\R                  S\R                  4S jr	\
S\R                  R                  S	\R                  S
\S\R                  4S j5       rSrU =r$ )r      a  
A recipe module designed to make a `PreTrainedModel` exportable with `torch.export`,
specifically for decoder-only LM to `StaticCache`. This module ensures that the
exported model is compatible with further lowering and execution in `ExecuTorch`.

Note:
    This class is specifically designed to support export process using `torch.export`
    in a way that ensures the model can be further lowered and run efficiently in `ExecuTorch`.
r   c                   > [         TU ]  5         UR                  c  [        S5      eUR                  R                  (       d  [        S5      eUR                  R
                  S:w  a  [        S5      eXl        [        U R                  R                  U R                  R                  R                  R                  U R                  R                  R                  R                  U R                  R                  R                  R                  U R                  R                  S9U l        [        [!        U R                  R"                  5      5       HY  nU R%                  SU 3U R                  R"                  U   SS	9  U R%                  S
U 3U R                  R&                  U   SS	9  M[     [)        S U R                  R                  R*                   5       5      U l        U R,                  (       ar  [.        R0                  " [.        R2                  " U R                  R                  U R                  R                  [.        R4                  S95      nU R%                  SUSS	9  gg)a  
Initializes the wrapper module with the pretrained model.

Args:
    model (`PreTrainedModel`): The pretrained model to wrap. The model must have caching
    enabled and use a 'static' caching implementation.

Raises:
    AssertionError: If the pretrained model does not have caching enabled or if it does
    not use a 'static' caching implementation in `model.generation_config`.
NzkThe model must have a generation config to be exported with static caching. Please set `generation_config`.zvThe model must have caching enabled to be exported with static caching. Please set `generation_config.use_cache=True`.staticzThe model must use a 'static' caching implementation to be exported with static caching. Please set `generation_config.cache_implementation='static'`.r   r   r   rB   r0   
key_cache_F
persistentvalue_cache_c              3   ,   #    U  H
  nS U;   v   M     g7f)CausalLMN ).0archs     r!   	<genexpr>@TorchExportableModuleWithStaticCache.__init__.<locals>.<genexpr>  s     \<[DZ4/<[s   r/   mask)r   r   generation_configAssertionErrorr   r   r   r	   r   cache_config
batch_sizer   rB   r0   static_cacherR   len	key_cacheregister_buffervalue_cacheanyarchitectures	is_causalr4   trilonesr   )r   r   re   causal_maskr    s       r!   r   -TorchExportableModuleWithStaticCache.__init__   s    	 ""* 2 
 &&00 A 
 ""778C P 
 
'::$$::77DDOO**66CCQQ:://<<CC**""
 s4,,6678A  :aS!143D3D3N3Nq3Q^c d  <s!3T5F5F5R5RST5Ubg h 9 \DJJ<M<M<[<[\\>>**

%%33%%33**K    G r#   r$   r%   c           	          UR                   u  p4U R                  (       a  U R                  USU24   OSnUR                  S5      nU R                  nU R                  UUUUUSS9nUR                  $ )a`  
Forward pass of the module, which is compatible with the ExecuTorch runtime.

Args:
    input_ids (`torch.Tensor`): Tensor representing current input token id to the module.
    cache_position (`torch.Tensor`): Tensor representing current input position in the cache.

Returns:
    torch.Tensor: Logits output from the model.

This forward adapter serves two primary purposes:

1. **Making the Model `torch.export`-Compatible**:
    The adapter hides unsupported objects, such as the `Cache`, from the graph inputs and outputs,
    enabling the model to be exportable using `torch.export` without encountering issues.

2. **Ensuring Compatibility with `ExecuTorch` runtime**:
    The adapter matches the model's forward signature with that in `executorch/extension/llm/runner`,
    ensuring that the exported model can be executed in `ExecuTorch` out-of-the-box.
Nr   T)r$   attention_maskposition_idsr%   past_key_valuesr   )rS   r   r   	unsqueezer   r   rj   )	r   r$   r%   rh   seqlen	attn_maskr   r   outss	            r!   r)   ,TorchExportableModuleWithStaticCache.forward'  sz    * OO	:>..DIIngvg56d	%//2++zz$%)+  
 {{r#   r;   prompt_token_idsr=   r&   c           	      0   UR                   S   nX2-   nU R                  5        H7  u  pVUR                  S5      (       d  M  UR                   S   n[        XG5      n  O   / n[	        [        XC5      5       Hs  n	U R                  5       R                  USS2XS-   24   [        R                  " U	/[        R                  S9S9n
UR                  US   U	   R                  5       5        Mu     [        R                  " W
SS2SSS24   SS	9R                  5       nUR                  U5        [        U5      U:  a  U R                  5       R                  [        R                  " U//[        R                  S9[        R                  " [        U5      /[        R                  S9S9n
[        R                  " U
SS2SSS24   SS	9R                  5       nUR                  U5        [        U5      U:  a  M  [        R                  " U/[        R                  S9$ )
ay  
Generate a sequence of tokens using an exported program.

This util function is designed to test exported models by simulating the generation process.
It processes the input prompt tokens sequentially (no parallel prefill).
This generate function is not intended to replace the original `generate` method, and the support
for leveraging the original `generate` is potentially planned!

Args:
    exported_program (`torch.export.ExportedProgram`): The exported program generated via `torch.export`.
    prompt_token_ids (`torch.Tensor`): Tensor representing the input prompt token IDs.
    max_new_tokens (`int`): Maximum number of new tokens to generate. Note that the total generation
        length is limited by both `max_new_tokens` and the model's cache size.

Returns:
    torch.Tensor: A tensor containing the generated sequence of token IDs, including the original prompt tokens.
rG   r   r   Nr.   r/   )r$   r%   r   rJ   )rS   named_buffers
startswithminrR   rO   r)   r4   r5   r6   appendr^   r[   r   )r;   r   r=   prompt_token_lenmax_generation_lengthbuffer_namebufferr   response_tokens	input_posresultcurrent_tokens               r!   rr   -TorchExportableModuleWithStaticCache.generateK  s   * ,11"5 0 A#3#A#A#CK%%k22 &Q(+,A(Q%	 $D s#8KLI%,,.66*1ia-.G+GH$||YKuzzJ 7 F ""#3A#6y#A#F#F#HI M VAr1H%52>CCE}-/"%::%,,.66,,'8

K$||S-A,B%**U 7 F "LL2q)9rBGGIM""=1 /"%:: ||_-UZZ@@r#   )r   r   r   )rz   r{   r|   r}   r~   r   r   r4   r   r)   r   r7   r   r   rr   r   r   r   s   @r!   r   r      s    6Ho 6Hp" "u|| "H /A,,66/AJO,,/Ahk/A	/A /Ar#   r   c                      ^  \ rS rSrSr  SS\S\S\4U 4S jjjrS\R                  S\R                  S	\R                  4S
 jr
SrU =r$ )r   i~  z
A recipe module designed to make a `PreTrainedModel` exportable with `torch.export`,
specifically for decoder-only LM to `HybridCache`. This module ensures that the
exported model is compatible with further lowering and execution in `ExecuTorch`.
r   r   r   c                   > [         TU ]  5         Xl        U R                  R                  R                  (       d  [        S5      e[        U R                  R                  S5      (       a$  U R                  R                  R                  S:w  a  [        S5      e[        U R                  R                  UUU R                  R                  U R                  R                  S9U l        [        [        U R                  R                  5      5       HY  nU R                  SU 3U R                  R                  U   SS9  U R                  S	U 3U R                  R                   U   SS9  M[     g
)aZ  
Initializes the exportable module with `HybridCache`.

Args:
    model (`PreTrainedModel`): The pretrained model to wrap.
    max_batch_size (int): Maximum batch size for the cache.
    max_cache_len (int): Maximum sequence length for the cache.

Raises:
    AssertionError: If the model doesn't have the expected configuration for HybridCache.
zModel must have caching enabledr   r   z,Model must use 'hybrid' cache implementationr   r   Fr   r   N)r   r   r   r   r   r   r   r   r   rB   r0   cacherR   r   r   r   r   )r   r   r   r   re   r    s        r!   r   -TorchExportableModuleWithHybridCache.__init__  s'   " 	
 zz  ** !BCC 

))+ABBzz  55A !OPP !::$$)'::$$**""

 s4:://01A  :aS!14::3G3G3JW\ ]  <s!3TZZ5K5KA5N[` a 2r#   r$   r%   r&   c           	         UR                   u  p4UR                  S5      R                  US5      n[        R                  " X44[        R
                  UR                  S9nU R                  UUUU R                  SUS9nUR                  $ )r(   r   rG   rF   T)r$   r   r   r   r   r%   )
rS   r   expandr4   r   r6   rB   r   r   rj   )r   r$   r%   r   seq_lenr   r   ri   s           r!   r)   ,TorchExportableModuleWithHybridCache.forward  s     (oo
 &//299*bI Z$9T]TdTde **)% JJ)  
 ~~r#   )r   r   rt   )rz   r{   r|   r}   r~   r   r   r   r4   r   r)   r   r   r   s   @r!   r   r   ~  sn      !	*b*b *b 	*b *bX"<<" " 
	" "r#   r   r   r8   r9   r+   r,   c           	      \   [         (       d  [        S5      eSSKnUR                  " 5          Ub  UOUR                  " S//UR
                  S9nUb  UOUR                  " S/UR
                  S9n[        S5      (       a-  UR                  R                  [        U 5      X40 UUb  UOSS9nOeUb  [        R                  " S	5        Ub  [        R                  " S
5        UR                  R                  R                  [        U 5      U4SU0SSS9nUsSSS5        $ ! , (       d  f       g= f)a  
Convert a `PreTrainedModel` into an exportable module and export it using `torch.export`,
ensuring the exported model is compatible with `ExecuTorch`.

Args:
    model (`PreTrainedModel`): The pretrained model to be exported.
    example_input_ids (`Optional[torch.Tensor]`): Example input token id used by `torch.export`.
    example_cache_position (`Optional[torch.Tensor]`): Example current cache position used by `torch.export`.
    dynamic_shapes(`Optional[dict]`): Dynamic shapes used by `torch.export`.
    strict(`Optional[bool]`): Flag to instruct `torch.export` to use `torchdynamo`.

Returns:
    Exported program (`torch.export.ExportedProgram`): The exported program generated via `torch.export`.
ztorch >= 2.3 is required.r   Nr.   r/   z2.6.0Tr1   zWDynamic shapes spec will be ignored by convert_and_export_with_cache for torch < 2.6.0.zSThe strict flag will be ignored by convert_and_export_with_cache for torch < 2.6.0.r%   F)r2   r3   pre_dispatchr,   )r   ImportErrortorch.export._traceno_gradr5   r6   r
   r7   r   r   warning_trace_export)r   r8   r9   r+   r,   r4   r;   s          r!   convert_and_export_with_cacher     s5   * .-566	 "3!>ELLSTRUQV^c^h^hDi 	 '=&H"ell\][^fkfpfpNq 	 %W--$||224U;'@-!'!3v  3   )m ! uv
  %||22::4U;')(*@A"  ;    G 
s   C'D
D+c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ ) Seq2SeqLMEncoderExportableModulei  z
A wrapper module designed to make a Seq2Seq LM encoder exportable with `torch.export`.
This module ensures that the exported encoder model is compatible with ExecuTorch.
c                 .   > [         TU ]  5         Xl        g )N)r   r   encoder)r   encoder_modelr    s     r!   r   )Seq2SeqLMEncoderExportableModule.__init__  s    $r#   c                 4    U R                  US9R                  $ )N)r$   )r   last_hidden_state)r   r$   s     r!   r)   (Seq2SeqLMEncoderExportableModule.forward   s    ||i|0BBBr#   )r   	rz   r{   r|   r}   r~   r   r)   r   r   r   s   @r!   r   r     s    
%C Cr#   r   c                   2   ^  \ rS rSrSrU 4S jrS rSrU =r$ )/Seq2SeqLMDecoderExportableModuleWithStaticCachei$  z
A wrapper module designed to make a Seq2Seq LM decoder exportable with `torch.export`,
specifically for use with static caching. This module ensures the exported decoder
is compatible with ExecuTorch.
c                   > [         TU ]  5         UR                  5       U l        UR                  U l        UR
                  U l        [        U R
                  UUS[        R                  S9U l	        [        [        U R                  R                  5      5       HY  nU R                  SU 3U R                  R                  U   SS9  U R                  SU 3U R                  R                  U   SS9  M[     g )Nry   r   r   Fr   r   )r   r   get_decoderdecoderlm_headr   r	   r4   float32r   rR   r   r   r   r   )r   r   max_static_cache_lengthr   re   r    s        r!   r   8Seq2SeqLMDecoderExportableModuleWithStaticCache.__init__+  s     ((*}}ll (;;%1--
 s4,,6678A  :aS!143D3D3N3Nq3Q^c d  <s!3T5F5F5R5RST5Ubg h 9r#   c                 h    U R                  UUU R                  SUS9nU R                  US   5      nU$ )NT)r$   encoder_hidden_statesr   r   r%   r   )r   r   r   )r   decoder_input_idsr   r%   ri   	lm_logitss         r!   r)   7Seq2SeqLMDecoderExportableModuleWithStaticCache.forwardA  sD    ,,'"7 --)  
 LL,	r#   )r   r   r   r   r   r   s   @r!   r   r   $  s    i, r#   r   c                   J   ^  \ rS rSr SU 4S jjrS rS rS	S jrS rSr	U =r
$ )
Seq2SeqLMExportableModuleiQ  c                    > [         TU ]  5         Xl        UR                  5       U l        UR
                  U l        X0l        [        SUUUUS.S9U l        S U l	        S U l
        g )NT)r   r   )r   
max_lengthr   r   )r   r   
full_modelget_encoderr   r   max_hidden_seq_lengthr   r   exported_encoderexported_decoder)r   r   r   r   r   max_cache_lengthr    s         r!   r   "Seq2SeqLMExportableModule.__init__R  si     	((*ll%:"!1'!5(!1	"
 !% $r#   c                 b   [        U R                  5      R                  S5      R                  5       n[        R
                  R                  SU R                  S9n[        R                  " 5          [        R
                  R                  X!4SSU00SS9nS S S 5        U$ ! , (       d  f       W$ = f)Nry   encoder_seq_lengthmaxr$   r.   Tr+   r,   )	r   r   rP   evalr4   r7   Dimr   r   )r   encoder_input_idswrapped_encoderseq_len_dimr   s        r!   _export_encoder)Seq2SeqLMExportableModule._export_encoderg  s    :4<<HKKERWWY ll&&';A[A[&\ ]]_$||22!5{UVXcTdFenr  3   
   _
  s   0%B
B.c           	         [        U R                  U R                  R                  R                  U R                  R                  R
                  S9R                  S5      R                  5       n[        R                  R                  SU R                  S9n[        R                  " 5          [        R                  R                  UXU4S SU0S S.SS9nS S S 5        U$ ! , (       d  f       W$ = f)	N)r   r   r   ry   encoder_hidden_seq_lengthr   r.   )r   r   r%   Tr   )r   r   r   r   r   r   rP   r   r4   r7   r   r   r   )r   r   r   r%   wrapped_decoderencoder_seq_len_dimr   s          r!   _export_decoder)Seq2SeqLMExportableModule._export_decoderu  s    ;oo(,(>(>(K(K(Y(Y11>>II
 RYTV 	 $ll../JPTPjPj.k ]]_$||22">J)-./1D-E&* 
   3 	     _  s   ,)C
C.c                    Ub  UO"[         R                  " S[         R                  S9nUb  UO$[         R                  " S//[         R                  S9nUb  UO#[         R                  " S/[         R                  S9nUb  UOW[         R                  " U R
                  R                  R                  SU R                  R                  4[         R                  S9nU R                  U5      U l        U R                  XhU5      U l        U $ )N)r.   
   r/   r   r	  )r4   r   r6   r5   zerosr   r   r   r   d_modelr   r   r   r  r   )	r   r   r   r   r%   example_encoder_input_idsexample_decoder_input_idsr9   example_encoder_hidden_statess	            r!   r7    Seq2SeqLMExportableModule.export  s    !2!>EJJw^c^h^hDi 	" "3!>ELLSTRUQV^c^h^hDi 	" 4B3MSXS_S_ab`ckpkukuSv %0 "''44??T[[EXEXYafanan 	& !% 4 45N O $ 4 4%F\!

 r#   c                    [         R                  " 5          U R                  R                  5       " U5      n[         R                  " S//[         R
                  S9nS/n[        US-
  5       H  nU R                  R                  5       " XC[         R                  " U/[         R
                  S95      n[         R                  " US S 2SS S 24   SS9R                  5       nUR                  U5        [         R                  " U//[         R
                  S9nXR                  R                  :X  d  M    O   UsS S S 5        $ ! , (       d  f       g = f)Nr   r/   r.   rG   rJ   )r4   r   r   rO   r5   r6   rR   r   r[   r^   r   r   r_   )	r   r   r=   encoder_outputr   rc   re   rj   
next_tokens	            r!   rr   "Seq2SeqLMExportableModule.generate  s    ]]_!2299;<LMN !&qcU%** ECM >A-...557%u||QCuzz7Z
 #\\&B*:CHHJ
$$Z0 %*LL:,uzz$R! !9!99 /" !5 __s   DE 1E  
E)r   r   r   r   r   r   r   )r.   ru   r   i   rv   )rz   r{   r|   r}   r   r   r  r7   rr   r   r   r   s   @r!   r   r   Q  s$    os%*  :.! !r#   r   rv   )r   typingr   r4   +transformers.generation.configuration_utilsr   utils.import_utilsr   transformersr   r   r	   transformers.pytorch_utilsr
   r   nnModuler   r   r   r   r   r   r   r   r   r   r   r#   r!   <module>r     s      H 3 FFhELEHHOO ELPWA588?? WAtU588?? Ut 1559%)!= = -=  %U\\2=  TN	= 
 TN= @Cuxx C*ehhoo *Zs! s!r#   