
    sgZ                       d Z ddlmZ ddlZddlZddlmZ ddlmZm	Z	m
Z
mZ ddlZddlZddlmZ ddlmZmZmZmZmZ dd	lmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$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/ ddl0m1Z1  e/jd                  e3      Z4dZ5dZ6d Z7d2dZ8 G d de"jr                  jt                        Z; G d de"jr                  jt                        Z<e# G d de"jr                  jt                               Z= G d de      Z>e G d de+             Z?dZ@dZA e-de@       G d d e>             ZB G d! d"e"jr                  jt                        ZC e-d#e@       G d$ d%e>             ZD e-d&e@       G d' d(e>e             ZE e-d)e@       G d* d+e>e             ZF e-d,e@       G d- d.e>e              ZG e-d/e@       G d0 d1e>e             ZHy)3z
TF 2.0 XLM model.
    )annotationsN)	dataclass)DictOptionalTupleUnion   )get_tf_activation)TFBaseModelOutputTFMultipleChoiceModelOutputTFQuestionAnsweringModelOutputTFSequenceClassifierOutputTFTokenClassifierOutput)TFModelInputTypeTFMultipleChoiceLossTFPreTrainedModelTFQuestionAnsweringLossTFSequenceClassificationLossTFSequenceSummaryTFSharedEmbeddingsTFTokenClassificationLossget_initializerkeraskeras_serializableunpack_inputs)check_embeddings_within_bounds
shape_liststable_softmax)MULTIPLE_CHOICE_DUMMY_INPUTSModelOutputadd_code_sample_docstringsadd_start_docstrings%add_start_docstrings_to_model_forwardlogging   )	XLMConfigzFacebookAI/xlm-mlm-en-2048r&   c                   t        j                  t        |       D cg c];  }t        |      D cg c]$  }|t        j                  dd|dz  z  |z        z  & c}= c}}      }t	        j
                  t        j                  |d d dd df               |d d dd df<   t	        j
                  t        j                  |d d dd df               |d d dd df<   y c c}w c c}}w )Ni'     r   r%   )nparrayrangepowertfconstantsincos)n_posdimoutposjposition_encs         Z/var/www/html/venv/lib/python3.12/site-packages/transformers/models/xlm/modeling_tf_xlm.pycreate_sinusoidal_embeddingsr8   E   s    88hmnshtuadQVWZQ[\AcBHHUAaL34F$GG\uvL;;rvvl1add7&;<=C14a4L;;rvvl1add7&;<=C14a4L ]us   C$
)CC$
C$
c           
        t        |      d   }||}n;t        j                  | |j                        }|t        j                  |d      k  }|r\t        j
                  t        j                  t        j                  dd| f      || df      t        j                  |d| df            }n|}t        j                  j                  t        |      || g       |r,t        j                  j                  t        |      || | g       ||fS )zH
    Generate hidden states mask, and optionally an attention mask.
    r   dtyper%   axis)
r   r-   r+   r;   expand_dims
less_equaltilereshape	debuggingassert_equal)slenlengthscausalpadding_maskbsmaskalen	attn_masks           r7   	get_masksrL   K   s     
G	Q	B xxGMM2bnnW155 MMGGBJJtaD\2RqMBBJJtVWY]_`UaDb
	 	 LLj.T
;
!!*Y"7"dD9IJ?    c                  V     e Zd Z ej                         Z fdZd ZddZddZ	 xZ
S )TFXLMMultiHeadAttentionc                2   t        |   di | t        t        j                        | _        || _        || _        |j                  | _        | j                  | j                  z  dk(  sJ t        j                  j                  |t        |j                        d      | _        t        j                  j                  |t        |j                        d      | _        t        j                  j                  |t        |j                        d      | _        t        j                  j                  |t        |j                        d      | _        t        j                  j%                  |j&                        | _        t+               | _        || _        y )Nr   q_linkernel_initializernamek_linv_linout_lin )super__init__nextrO   NEW_IDlayer_idr2   n_headsoutput_attentionsr   layersDenser   init_stdrQ   rU   rV   rW   Dropoutattention_dropoutdropoutsetpruned_heads)selfr^   r2   configkwargs	__class__s        r7   rZ   z TFXLMMultiHeadAttention.__init__k   s2   "6"4;;<!'!9!9xx$,,&!+++\\''PVP_P_@`gn'o
\\''PVP_P_@`gn'o
\\''PVP_P_@`gn'o
||))#/RXRaRaBbir)s||++F,D,DEErM   c                    t         NNotImplementedError)rh   headss     r7   prune_headsz#TFXLMMultiHeadAttention.prune_heads{   s    !!rM   c                \    t        |      \  }}	|||n|d   |z   }
nt        |      d   }
 j                   j                  z  t        t        |            dk(  rd||
fndd|
f} fd} fd} | j	                  |            }|/ | j                  |            } | j                  |            }nB| j                  |vr2|x}} | j                  |            } | j                  |            }|x j                  |v rY|E| j                     \  }}t        j                  |gd      }t        j                  |gd      }n| j                     \  }}f| j                  <   t        j                  |j                        }t        j                  |t        j                  j                  |            }t        j                  |j                        }t        j                  ||d	
      }t        j                   ||      }t        j                  ||j                        }|dd|z
  z  z
  }t#        |d      } j%                  ||      }|||z  }t        j                  |      } ||      } j'                  |      f}|r||fz   }|S )zd
        Self-attention (if kv is None) or attention over source sentence (provided by kv).
        rD   r%   r	   c           	     v    t        j                  t        j                  | dj                  f      d      S )
projectionr   r(   r%   r	   perm)r-   	transposerA   r^   xrH   dim_per_headrh   s    r7   shapez+TFXLMMultiHeadAttention.call.<locals>.shape   s-    <<

1r2t||\.R SZfggrM   c                z    t        j                  t        j                  | d      dj                  z  f      S )zcompute contextrv   rw   ru   )r-   rA   ry   r^   rz   s    r7   unshapez-TFXLMMultiHeadAttention.call.<locals>.unshape   s0    ::bll1<@2r4<<ZfKfBghhrM   r(   r<   r:   T)transpose_bgꌠ9Y>)Fg      ?ru   training)r   r2   r^   lenrQ   rU   rV   r]   r-   concatcastr;   multiplymathrsqrtmatmulrA   r   re   rW   )rh   inputrI   kvcache	head_maskr_   r   qlenr2   klenmask_reshaper}   r   qkvk_v_f_dim_per_headscoresweightscontextoutputsrH   r|   s   `                       @@r7   callzTFXLMMultiHeadAttention.call~   sx    #5)D#: =4eFmd.BDb>!$D xx4<</.1*T2B.Cq.HAtT*rSTVWY]N^	h	i $**U#$:djj'(Adjj'(A]dmm58JAdjjm$Adjjm$A}}%:"4==1FB		2q'2A		2q'2A /DAq$%q6E$-- QWW=KK277==89GGAQWW%1aT2zz$-wwt6<<0$#*-- b1,,w,:  	)G))GQ''"<<(*
*GrM   c                   | j                   ry d| _         t        | dd       Zt        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        t        | dd       Zt        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        t        | dd       Zt        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        t        | dd       [t        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        y y # 1 sw Y   AxY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NTrQ   rU   rV   rW   )builtgetattrr-   
name_scoperQ   rT   buildr2   rU   rV   rW   rh   input_shapes     r7   r   zTFXLMMultiHeadAttention.build   ss   ::
4$'3tzz/ 9

  $dhh!7894$'3tzz/ 9

  $dhh!7894$'3tzz/ 9

  $dhh!7894D)5t||001 ;""D$#9:; ; 69 99 99 9; ;s0   )F32)G )G )G3F= G	GG!Frm   )__name__
__module____qualname__	itertoolscountr\   rZ   rq   r   r   __classcell__rk   s   @r7   rO   rO   h   s'    Y__F "DL;rM   rO   c                  .     e Zd Z fdZddZddZ xZS )TFXLMTransformerFFNc                   t        |   di | t        j                  j	                  |t        |j                        d      | _        t        j                  j	                  |t        |j                        d      | _        |j                  rt        d      n
t        d      | _        t        j                  j                  |j                        | _        || _        || _        y )Nlin1rR   lin2gelurelurX   )rY   rZ   r   r`   ra   r   rb   r   r   gelu_activationr
   actrc   re   in_dim
dim_hidden)rh   r   r   out_dimri   rj   rk   s         r7   rZ   zTFXLMTransformerFFN.__init__   s    "6"LL&&zoV\VeVeFfms&t	LL&&w?SYSbSbCcjp&q	060F0F$V,L]^dLe||++FNN;$rM   c                    | j                  |      }| j                  |      }| j                  |      }| j                  ||      }|S )Nr   )r   r   r   re   )rh   r   r   r{   s       r7   r   zTFXLMTransformerFFN.call   sA    IIeHHQKIIaLLLXL.rM   c                   | j                   ry d| _         t        | dd       Zt        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        t        | dd       [t        j                  | j                  j
                        5  | j                  j                  d d | j                  g       d d d        y y # 1 sw Y   rxY w# 1 sw Y   y xY w)NTr   r   )
r   r   r-   r   r   rT   r   r   r   r   r   s     r7   r   zTFXLMTransformerFFN.build   s    ::
4&2tyy~~. ;		tT[[ 9:;4&2tyy~~. ?		tT__ =>? ? 3; ;? ?s   )C%2)C1%C.1C:r   rm   )r   r   r   rZ   r   r   r   r   s   @r7   r   r      s    %	?rM   r   c                  l     e Zd ZeZ fdZddZd Zd Zd Z	e
	 	 	 	 	 	 	 	 	 	 	 	 	 d	 d	d       Z xZS )
TFXLMMainLayerc                   t        |   di | || _        |j                  | _        |j                  | _        |j
                  | _        |j                  | _        |j                   | _        | j                  rt        d      |j                  | _
        |j                  | _        |j                  | _        |j                  | _        |j                  | _        |j                  | _        |j                   | _        | j"                  dz  | _        |j&                  | _        |j(                  | _        |j*                  | _        |j,                  | _        | j"                  | j&                  z  dk7  rt/        d      t0        j2                  j5                  |j6                        | _        t0        j2                  j5                  |j8                        | _        |j:                  rt        t=        | j                  | j"                  |j,                  d      | _        t0        j2                  jA                  |jB                  d      | _"        g | _#        g | _$        g | _%        g | _&        tO        | j(                        D ]  }| jF                  jQ                  tS        | j&                  | j"                  |d	| 
             | jH                  jQ                  t0        j2                  jA                  |jB                  d|              | jJ                  jQ                  tU        | j"                  | j$                  | j"                  |d| 
             | jL                  jQ                  t0        j2                  jA                  |jB                  d|               tW        |d      r|jX                  j[                         j]                         }i |_,        |D ]h  \  }}| jF                  t_        |         j&                  |j&                  k(  s6| ja                  t_        |      tc        te        t^        |            i       j y y )Nz,Currently XLM can only be used as an encoder   r   z-transformer dim must be a multiple of n_heads
embeddingsinitializer_rangerT   layer_norm_emb)epsilonrT   zattentions_._)ri   rT   zlayer_norm1_._zffns_._zlayer_norm2_._rg   rX   )3rY   rZ   ri   output_hidden_statesr_   use_return_dictreturn_dict
is_encoder
is_decoderro   rF   n_langsuse_lang_embn_words	eos_index	pad_indexemb_dimr2   
hidden_dimr^   n_layersmax_position_embeddingsembed_init_std
ValueErrorr   r`   rc   re   rd   sinusoidal_embeddingsr   r   LayerNormalizationlayer_norm_epsr   
attentionslayer_norm1ffnslayer_norm2r+   appendrO   r   hasattrrg   copyitemsintrq   listmap)rh   ri   rj   irg   layerrp   rk   s          r7   rZ   zTFXLMMainLayer.__init__   sr   "6"$*$?$?!!'!9!9!11 !++$///??%&TUU mm ~~"//~~)))) >>((Q,~~'-'E'E$$3388dll"a'LMM ||++FNN;!&!5!5f6N6N!O''%% -LL$((f6K6KR^
 $ll==fF[F[br=s 	
 t}}% 	AOO""'dhhvVcdecfTgh ##//8M8MVdefdgTh/i II#DHHdootxxPV_fghfi]jk ##//8M8MVdefdgTh/i	" 6>*!..335;;=L"$F , Ju??3u:.66&..H$$c%j$s32G%HIJ	 +rM   c                   | j                   ry d| _         t        j                  d      5  | j                  d| j                  | j
                  gt        | j                              | _        d d d        | j                  dkD  rl| j                  r`t        j                  d      5  | j                  d| j                  | j
                  gt        | j                              | _        d d d        t        | dd       Mt        j                  | j                  j                        5  | j                  j                  d        d d d        t        | dd       Zt        j                  | j                   j                        5  | j                   j                  d d | j
                  g       d d d        | j"                  D ];  }t        j                  |j                        5  |j                  d        d d d        = | j$                  D ]H  }t        j                  |j                        5  |j                  d d | j
                  g       d d d        J | j&                  D ];  }t        j                  |j                        5  |j                  d        d d d        = | j(                  D ]H  }t        j                  |j                        5  |j                  d d | j
                  g       d d d        J y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   txY w# 1 sw Y   uxY w# 1 sw Y   8xY w# 1 sw Y   xY w# 1 sw Y   xY w)NTposition_embeddingsr   )rT   r}   initializerr%   lang_embeddingsr   )r   r-   r   
add_weightr   r2   r   r   r   r   r   r   r   r   rT   r   r   r   r   r   r   )rh   r   r   s      r7   r   zTFXLMMainLayer.buildP  s   ::
]]01 	'+!33TXX>+D,?,?@ (7 (D$	 <<! 1 101 '+%<<2 /0C0C D (7 ($ 4t,8t334 ,%%d+,4)40<t22778 B##))4txx*@AB__ 	"Euzz* "D!" "	" %% 	4Euzz* 4T4234 4	4 YY 	"Euzz* "D!" "	" %% 	4Euzz* 4T4234 4	4;	 	 , ,B B" "4 4" "4 4sa   AK4%AL&L )LL()L5 M
M4K>LLL%(L2	5L?	M	M	c                    | j                   S rm   )r   rh   s    r7   get_input_embeddingsz#TFXLMMainLayer.get_input_embeddingsu      rM   c                `    || j                   _        t        |      d   | j                   _        y Nr   )r   weightr   
vocab_sizerh   values     r7   set_input_embeddingsz#TFXLMMainLayer.set_input_embeddingsx  s$    !&%/%6q%9"rM   c                    t         )z
        Prunes heads of the model. heads_to_prune: dict of {layer_num: list of heads to prune in this layer} See base
        class PreTrainedModel
        rn   )rh   heads_to_prunes     r7   _prune_headszTFXLMMainLayer._prune_heads|  s
    
 "!rM   c           
        ||	t        d      |t        |      \  }}n|	t        |	      d d \  }}nt        d      |p|Ut        j                  t        j                  t        j
                  || j                        |j                        d      }nt        j                  |g|z        }t        j                  j                  t        |      d   |      dt        |      d    d	| d
f t        ||| j                  |      \  }}|Bt        j                  t        j                  |      d      }t        j                  ||df      }t        j                  j                  t        |      ||g      dt        |       d||g d
f |?t        j                  j                  t        |      ||g      dt        |       d||g d
f |t         d g| j"                  z  }|H|F||d   z
  }|d d | d f   }|d d | d f   }||d d | d f   }|d d | d f   }|d d | d f   }|	1t%        || j&                  j(                         | j'                  |      }	|	t        j*                  | j,                  |      z   }|>| j.                  r2| j0                  dkD  r#|t        j*                  | j2                  |      z   }||| j'                  |      z   }| j5                  |      }| j7                  ||      }t        j                  ||j                        }|t        j                  |d      z  }|rdnd }|
rdnd }t        | j"                        D ]  }|r||fz   } | j8                  |   ||d |||   |
|      }|d   }|
r	||d   fz   }| j7                  ||      }||z   } | j:                  |   |      }| | j<                  |   |      z   } | j>                  |   |      }|t        j                  |d      z  } |r||fz   }||dxx   |jA                  d      z  cc<   |stC        d |||fD              S tE        |||      S )NzDYou cannot specify both input_ids and inputs_embeds at the same timer(   z5You have to specify either input_ids or inputs_embedsr:   r%   r<   r   zExpected batch size z and received batch size z mismatched)rG   zPosition id shape z and input shape zLang shape rD   r   ru   rX   c              3  &   K   | ]	  }||  y wrm   rX   ).0r   s     r7   	<genexpr>z&TFXLMMainLayer.call.<locals>.<genexpr>'  s     Yq1=Ys   )last_hidden_statehidden_statesr   )#r   r   r-   
reduce_sumr   	not_equalr   r;   convert_to_tensorrB   rC   rL   rF   r>   r+   r@   ro   r   r   r   r   gatherr   r   r   r   r   re   r   r   r   r   sizetupler   )rh   	input_idsattention_masklangstoken_type_idsposition_idsrE   r   r   inputs_embedsr_   r   r   r   rH   rD   rI   rK   _slentensorr   r   r   attn_outputsattns                            r7   r   zTFXLMMainLayer.call  s   &  ]%>cdd"!),HB&!-0!4HBTUU?$--GGBLLDNNC9??[bc ..v{; LL%%j&9!&<bA":g#6q#9"::STVSWWbc	
 $D'4;;^\i
 >>"((4.qAL77<"a9L LL%%j&>T
K L!9 ::KRQUJ<Wbc	
  ))*U*;b$ZHj/00A2t*[Y  %%.I !65=(E!!eVW*-I'E67
3L a%j)E67
#D!!eVW*-I  *9doo6P6PQ OOI6M4+C+C\!RR!2!2t||a7Gbii(<(<eDDF%doon==F$$V,fx8wwt6<<0"..B77 3,R$
t}}% !	<A# -	 9 .4??1-!!!L  ?D '<?*<<
<<x<8Dd]F(T%%a(0F ldiil622F(T%%a(0FbnnT;;FC!	<H  )VI5M &MV[[^+M
 YV]J$GYYY 6cmnnrM   rm   NNNNNNNNNNNNF)returnz*Union[TFBaseModelOutput, Tuple[tf.Tensor]])r   r   r   r&   config_classrZ   r   r   r   r   r   r   r   r   s   @r7   r   r      sr    LUJn#4J:"  !eo 
4eo eorM   r   c                  (    e Zd ZdZeZdZed        Zy)TFXLMPreTrainedModelz
    An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
    models.
    transformerc                   t        j                  g dg dg dgt         j                        }t        j                  g dg dg dgt         j                        }| j                  j                  rK| j                  j
                  dkD  r2||t        j                  g dg dg dgt         j                        d	S ||d
S )N)      r   r   r%   )r%   r(   r	   r   r   )r   r   r   r      r:   )r%   r%   r   r   r%   )r%   r%   r%   r   r   )r%   r   r   r%   r%   r%   )r  r  r  )r  r  )r-   r.   int32ri   r   r   )rh   inputs_list
attns_lists      r7   dummy_inputsz!TFXLMPreTrainedModel.dummy_inputs5  s     kk?O_"U]_]e]ef[[/?O!T\^\d\de
;;##(;(;a(?(",o%X`b`h`hi  "-
KKrM   N)	r   r   r   __doc__r&   r  base_model_prefixpropertyr  rX   rM   r7   r  r  ,  s(    
 L%L LrM   r  c                  <    e Zd ZU dZdZded<   dZded<   dZded<   y)TFXLMWithLMHeadModelOutputa^  
    Base class for [`TFXLMWithLMHeadModel`] outputs.

    Args:
        logits (`tf.Tensor` 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(tf.Tensor)`, *optional*, returned when `output_hidden_states=True` is passed or when `config.output_hidden_states=True`):
            Tuple of `tf.Tensor` (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(tf.Tensor)`, *optional*, returned when `output_attentions=True` is passed or when `config.output_attentions=True`):
            Tuple of `tf.Tensor` (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.
    Nz	tf.TensorlogitszTuple[tf.Tensor, ...] | Noner   r   )r   r   r   r  r  __annotations__r   r   rX   rM   r7   r  r  E  s)    & FI26M/6/3J,3rM   r  ay	  

    This model inherits from [`TFPreTrainedModel`]. Check the superclass documentation for the generic methods the
    library implements for all its model (such as downloading or saving, resizing the input embeddings, pruning heads
    etc.)

    This model is also a [keras.Model](https://www.tensorflow.org/api_docs/python/tf/keras/Model) subclass. Use it
    as a regular TF 2.0 Keras Model and refer to the TF 2.0 documentation for all matter related to general usage and
    behavior.

    <Tip>

    TensorFlow models and layers in `transformers` accept two formats as input:

    - having all inputs as keyword arguments (like PyTorch models), or
    - having all inputs as a list, tuple or dict in the first positional argument.

    The reason the second format is supported is that Keras methods prefer this format when passing inputs to models
    and layers. Because of this support, when using methods like `model.fit()` things should "just work" for you - just
    pass your inputs and labels in any format that `model.fit()` supports! If, however, you want to use the second
    format outside of Keras methods like `fit()` and `predict()`, such as when creating your own layers or models with
    the Keras `Functional` API, there are three possibilities you can use to gather all the input Tensors in the first
    positional argument:

    - a single Tensor with `input_ids` only and nothing else: `model(input_ids)`
    - a list of varying length with one or several input Tensors IN THE ORDER given in the docstring:
    `model([input_ids, attention_mask])` or `model([input_ids, attention_mask, token_type_ids])`
    - a dictionary with one or several input Tensors associated to the input names given in the docstring:
    `model({"input_ids": input_ids, "token_type_ids": token_type_ids})`

    Note that when creating models and layers with
    [subclassing](https://keras.io/guides/making_new_layers_and_models_via_subclassing/) then you don't need to worry
    about any of this, as you can just pass inputs like you would to any other Python function!

    </Tip>

    Parameters:
        config ([`XLMConfig`]): Model configuration class with all the parameters of the model.
            Initializing with a config file does not load the weights associated with the model, only the
            configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.
a  
    Args:
        input_ids (`Numpy array` or `tf.Tensor` of shape `({0})`):
            Indices of input sequence tokens in the vocabulary.

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

            [What are input IDs?](../glossary#input-ids)
        attention_mask (`Numpy array` or `tf.Tensor` of shape `({0})`, *optional*):
            Mask to avoid performing attention on padding token indices. Mask values selected in `[0, 1]`:

            - 1 for tokens that are **not masked**,
            - 0 for tokens that are **masked**.

            [What are attention masks?](../glossary#attention-mask)
        langs (`tf.Tensor` or `Numpy array` of shape `({0})`, *optional*):
            A parallel sequence of tokens to be used to indicate the language of each token in the input. Indices are
            languages ids which can be obtained from the language names by using two conversion mappings provided in
            the configuration of the model (only provided for multilingual models). More precisely, the *language name
            to language id* mapping is in `model.config.lang2id` (which is a dictionary string to int) and the
            *language id to language name* mapping is in `model.config.id2lang` (dictionary int to string).

            See usage examples detailed in the [multilingual documentation](../multilingual).
        token_type_ids (`Numpy array` or `tf.Tensor` of shape `({0})`, *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.

            [What are token type IDs?](../glossary#token-type-ids)
        position_ids (`Numpy array` or `tf.Tensor` of shape `({0})`, *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)
        lengths (`tf.Tensor` or `Numpy array` of shape `(batch_size,)`, *optional*):
            Length of each sentence that can be used to avoid performing attention on padding token indices. You can
            also use *attention_mask* for the same result (see above), kept here for compatibility. Indices selected in
            `[0, ..., input_ids.size(-1)]`.
        cache (`Dict[str, tf.Tensor]`, *optional*):
            Dictionary string to `tf.Tensor` that contains precomputed hidden states (key and values in the attention
            blocks) as computed by the model (see `cache` output below). Can be used to speed up sequential decoding.

            The dictionary object will be modified in-place during the forward pass to add newly computed
            hidden-states.
        head_mask (`Numpy array` or `tf.Tensor` of shape `(num_heads,)` or `(num_layers, num_heads)`, *optional*):
            Mask to nullify selected heads of the self-attention modules. Mask values selected in `[0, 1]`:

            - 1 indicates the head is **not masked**,
            - 0 indicates the head is **masked**.

        inputs_embeds (`tf.Tensor` of shape `({0}, 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.
        output_attentions (`bool`, *optional*):
            Whether or not to return the attentions tensors of all attention layers. See `attentions` under returned
            tensors for more detail. This argument can be used only in eager mode, in graph mode the value in the
            config will be used instead.
        output_hidden_states (`bool`, *optional*):
            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for
            more detail. This argument can be used only in eager mode, in graph mode the value in the config will be
            used instead.
        return_dict (`bool`, *optional*):
            Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple. This argument can be used in
            eager mode, in graph mode the value will always be set to True.
        training (`bool`, *optional*, defaults to `False`):
            Whether or not to use the model in training mode (some modules like dropout modules have different
            behaviors between training and evaluation).
z]The bare XLM Model transformer outputting raw hidden-states without any specific head on top.c                       e Zd Z fdZe eej                  d             ee	e
e      	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                     ZddZ xZS )	
TFXLMModelc                P    t        |   |g|i | t        |d      | _        y )Nr  rT   )rY   rZ   r   r  rh   ri   inputsrj   rk   s       r7   rZ   zTFXLMModel.__init__  s)    3&3F3)&}ErM   batch_size, sequence_length
checkpointoutput_typer  c                B    | j                  |||||||||	|
|||      }|S )Nr  r  r  r  r  rE   r   r   r  r_   r   r   r   )r  )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   r   r   s                  r7   r   zTFXLMModel.call  sG    . ""))%'/!5# # 
  rM   c                    | j                   ry d| _         t        | dd       Nt        j                  | j                  j
                        5  | j                  j                  d        d d d        y y # 1 sw Y   y xY w)NTr  )r   r   r-   r   r  rT   r   r   s     r7   r   zTFXLMModel.build  sm    ::
4-9t//445 -  &&t,- - :- -s   A11A:r  )r  TFModelInputType | Noner  tf.Tensor | Noner  r.  r  r.  r  r.  rE   r.  r   zDict[str, tf.Tensor] | Noner   r.  r  r.  r_   bool | Noner   r/  r   r/  r   boolr  z$TFBaseModelOutput | Tuple[tf.Tensor]rm   )r   r   r   rZ   r   r#   XLM_INPUTS_DOCSTRINGformatr!   _CHECKPOINT_FOR_DOCr   _CONFIG_FOR_DOCr   r   r   r   s   @r7   r!  r!    s   
F *+?+F+FGd+ef&%$ .2+/"&+/)-$(-1&**.)-,0#' *  )   	 
 )  '  "  +  $  (  '  *  !    
.  g  D-rM   r!  c                  J     e Zd ZdZ fdZ fdZd Zd Zd Zd Z	d Z
 xZS )	TFXLMPredLayerz?
    Prediction layer (cross_entropy or adaptive_softmax).
    c                    t        |   di | |j                  | _        |j                  | _        |j                  | _        |j                  du r|| _        y t        )NFrX   )rY   rZ   asmr   r   input_embeddingsro   )rh   ri   r9  rj   rk   s       r7   rZ   zTFXLMPredLayer.__init__  sP    "6"::~~))::$4D!%%rM   c                n    | j                  | j                  fddd      | _        t        |   |       y )NzerosTbias)r}   r   	trainablerT   )r   r   r<  rY   r   )rh   r   rk   s     r7   r   zTFXLMPredLayer.build&  s/    OO4<</wZ^ekOl	k"rM   c                    | j                   S rm   )r9  r   s    r7   get_output_embeddingsz$TFXLMPredLayer.get_output_embeddings,  s    $$$rM   c                `    || j                   _        t        |      d   | j                   _        y r   )r9  r   r   r   r   s     r7   set_output_embeddingsz$TFXLMPredLayer.set_output_embeddings/  s(    ',$+5e+<Q+?(rM   c                    d| j                   iS )Nr<  )r<  r   s    r7   get_biaszTFXLMPredLayer.get_bias3  s    		""rM   c                D    |d   | _         t        |d         d   | _        y )Nr<  r   )r<  r   r   r   s     r7   set_biaszTFXLMPredLayer.set_bias6  s"    &M	$U6]3A6rM   c                J    | j                  |d      }|| j                  z   }|S )Nlinear)mode)r9  r<  )rh   r   s     r7   r   zTFXLMPredLayer.call:  s+    --m(-K%		1rM   )r   r   r   r  rZ   r   r?  rA  rC  rE  r   r   r   s   @r7   r6  r6    s,    
&&#%@#7rM   r6  z
    The XLM Model transformer with a language modeling head on top (linear layer with weights tied to the input
    embeddings).
    c                       e Zd Z fdZd Zd Zd Ze ee	j                  d             eeee      	 	 	 	 	 	 	 	 	 	 	 	 	 d		 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d
d                     ZddZ xZS )TFXLMWithLMHeadModelc                    t        |   |g|i | t        |d      | _        t	        || j                  j
                  d      | _        d| _        y )Nr  r#  zpred_layer_._projF)rY   rZ   r   r  r6  r   
pred_layersupports_xla_generationr$  s       r7   rZ   zTFXLMWithLMHeadModel.__init__I  sN    3&3F3)&}E(1A1A1L1LSfg',$rM   c                    | j                   S rm   )rL  r   s    r7   get_lm_headz TFXLMWithLMHeadModel.get_lm_headP  r   rM   c                    t        j                  dt               | j                  dz   | j                  j                  z   S )NzMThe method get_prefix_bias_name is deprecated. Please use `get_bias` instead./)warningswarnFutureWarningrT   rL  r   s    r7   get_prefix_bias_namez)TFXLMWithLMHeadModel.get_prefix_bias_nameS  s/    egtuyy3!5!555rM   c                $   | j                   j                  }| j                   j                  }|j                  d   }t	        j
                  |dfd      |z  }t	        j                  ||gd      }|t	        j                  |      |z  }nd }||dS )Nr   r%   r<   r  r  )ri   mask_token_idlang_idr}   r-   fillr   	ones_like)rh   r%  rj   rX  rY  effective_batch_size
mask_tokenr  s           r7   prepare_inputs_for_generationz2TFXLMWithLMHeadModel.prepare_inputs_for_generationW  s    11++%%%||AWW2A6:]J
FJ/a8LL(72EE#e44rM   r&  r'  c                    | j                  |||||||||	|
|||      }|d   }| j                  |      }|s	|f|dd  z   S t        ||j                  |j                        S )Nr+  r   r%   )r  r   r   )r  rL  r  r   r   )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   r   transformer_outputsoutputr   s                    r7   r   zTFXLMWithLMHeadModel.calle  s    . #..))%'/!5# / 
  %Q'//&): 3AB 777)*=*K*KXkXvXv
 	
rM   c                   | j                   ry d| _         t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       Nt        j                  | j                  j
                        5  | j                  j                  d        d d d        y y # 1 sw Y   exY w# 1 sw Y   y xY w)NTr  rL  )r   r   r-   r   r  rT   r   rL  r   s     r7   r   zTFXLMWithLMHeadModel.build  s    ::
4-9t//445 -  &&t,-4t,8t334 ,%%d+, , 9- -, ,   C%CCC r  )r  r-  r  np.ndarray | tf.Tensor | Noner  rd  r  rd  r  rd  rE   rd  r   Optional[Dict[str, tf.Tensor]]r   rd  r  rd  r_   Optional[bool]r   rf  r   rf  r   r0  r  z3Union[TFXLMWithLMHeadModelOutput, Tuple[tf.Tensor]]rm   )r   r   r   rZ   rO  rU  r^  r   r#   r1  r2  r!   r3  r  r4  r   r   r   r   s   @r7   rJ  rJ  A  s   -65 *+?+F+FGd+ef&.$ .28</38<6:1504377;,0/3&*(
*(
 6(
 -	(

 6(
 4(
 /(
 .(
 1(
 5(
 *(
 -(
 $(
 (
 
=(
 g (
T	,rM   rJ  z
    XLM Model with a sequence classification/regression head on top (a linear layer on top of the pooled output) e.g.
    for GLUE tasks.
    c                       e Zd Z fdZe eej                  d             ee	e
e      	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                     ZddZ xZS )	TFXLMForSequenceClassificationc                    t        |   |g|i | |j                  | _        t        |d      | _        t        ||j                  d      | _        y )Nr  r#  sequence_summaryr   )rY   rZ   
num_labelsr   r  r   rb   rj  r$  s       r7   rZ   z'TFXLMForSequenceClassification.__init__  sL    3&3F3 ++)&}E 1&FOObt urM   r&  r'  c                   | j                  |||||||||	|
|||      }|d   }| j                  |      }|dn| j                  ||      }|s|f|dd z   }||f|z   S |S t        |||j                  |j
                        S )a  
        labels (`tf.Tensor` 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).
        r+  r   Nr%   lossr  r   r   )r  rj  hf_compute_lossr   r   r   )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   labelsr   r`  ra  r  rn  s                      r7   r   z#TFXLMForSequenceClassification.call  s    < #..))%'/!5# / 
 %Q'&&v.~t4+?+?+OY!4QR!88F)-)9TGf$EvE)-;;*55	
 	
rM   c                   | j                   ry d| _         t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       Nt        j                  | j                  j
                        5  | j                  j                  d        d d d        y y # 1 sw Y   exY w# 1 sw Y   y xY w)NTr  rj  )r   r   r-   r   r  rT   r   rj  r   s     r7   r   z$TFXLMForSequenceClassification.build  s    ::
4-9t//445 -  &&t,-4+T2>t4499: 2%%++D12 2 ?- -2 2rc  NNNNNNNNNNNNNF)r  r-  r  rd  r  rd  r  rd  r  rd  rE   rd  r   re  r   rd  r  rd  r_   rf  r   rf  r   rf  rp  rd  r   r0  r  z3Union[TFSequenceClassifierOutput, Tuple[tf.Tensor]]rm   )r   r   r   rZ   r   r#   r1  r2  r!   r3  r   r4  r   r   r   r   s   @r7   rh  rh    s   v *+?+F+FGd+ef&.$ .28</38<6:1504377;,0/3&*045
*5
 65
 -	5

 65
 45
 /5
 .5
 15
 55
 *5
 -5
 $5
 .5
 5
  
=!5
 g 5
n	2rM   rh  z
    XLM Model with a multiple choice classification head on top (a linear layer on top of the pooled output and a
    softmax) e.g. for RocStories/SWAG tasks.
    c                       e Zd Z fdZed        Ze eej                  d             e
eee      	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                     Zd	dZ xZS )
TFXLMForMultipleChoicec                   t        |   |g|i | t        |d      | _        t	        ||j
                  d      | _        t        j                  j                  dt        |j                        d      | _        || _        y )Nr  r#  rj  r   r%   logits_projrR   )rY   rZ   r   r  r   rb   rj  r   r`   ra   r   r   rv  ri   r$  s       r7   rZ   zTFXLMForMultipleChoice.__init__  sw    3&3F3)&}E 1&FOObt u <<--/&2J2J"KR_ . 
 rM   c                \   | j                   j                  rl| j                   j                  dkD  rSt        j                  t
        t        j                        t        j                  t
        t        j                        dS dt        j                  t
        t        j                        iS )zn
        Dummy inputs to build the network.

        Returns:
            tf.Tensor with dummy inputs
        r%   r:   rW  r  )ri   r   r   r-   r.   r   r  r   s    r7   r  z#TFXLMForMultipleChoice.dummy_inputs  ss     ;;##(;(;a(?[[)ERXXV%AR  R[[)ERXXV rM   z(batch_size, num_choices, sequence_lengthr'  c                j   |t        |      d   }t        |      d   }nt        |	      d   }t        |	      d   }|t        j                  |d|f      nd }|t        j                  |d|f      nd }|t        j                  |d|f      nd }|t        j                  |d|f      nd }|t        j                  |d|f      nd }|	%t        j                  |	d|t        |	      d   f      nd }|t        j	                  d       d }| j                  ||||||||||
|||      }|d   }| j                  |      }| j                  |      }t        j                  |d|f      }|d n| j                  ||      }|s|f|dd  z   }||f|z   S |S t        |||j                  |j                        S )	Nr%   r(   ru   r	   zrThe `lengths` parameter cannot be used with the XLM multiple choice models. Please use the attention mask instead.)r   r   r   rm  )r   r-   rA   loggerwarningr  rj  rv  ro  r   r   r   )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   rp  r   num_choices
seq_lengthflat_input_idsflat_attention_maskflat_token_type_idsflat_position_ids
flat_langsflat_inputs_embedsr`  ra  r  reshaped_logitsrn  s                               r7   r   zTFXLMForMultipleChoice.call   s   0  $Y/2K#I.q1J$]3A6K#M215JDMDYIJ/?@_cN\Nhbjj"j9IJnrN\Nhbjj"j9IJnrJVJbBJJ|b*5EFhl<A<MRZZJ'78SW
 ( JJ}r:z-7PQR7S&TU 	 NN* G".. # / 
 %Q'&&v.!!&)**Vb+->?~t4+?+?+X%'*=ab*AAF)-)9TGf$EvE*"-;;*55	
 	
rM   c                   | j                   ry d| _         t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       et        j                  | j                  j
                        5  | j                  j                  d d | j                  j                  g       d d d        y y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   y xY w)NTr  rj  rv  )r   r   r-   r   r  rT   r   rj  rv  ri   rk  r   s     r7   r   zTFXLMForMultipleChoice.buildr  s$   ::
4-9t//445 -  &&t,-4+T2>t4499: 2%%++D124-9t//445 M  &&dDKK4J4J'KLM M :- -2 2M Ms$   D<%E?3E<EEErr  )r  r-  r  rd  r  rd  r  rd  r  rd  rE   rd  r   re  r   rd  r  rd  r_   rf  r   rf  r   rf  rp  rd  r   r0  r  z4Union[TFMultipleChoiceModelOutput, Tuple[tf.Tensor]]rm   )r   r   r   rZ   r  r  r   r#   r1  r2  r!   r3  r   r4  r   r   r   r   s   @r7   rt  rt    s9     $ *+?+F+FGq+rs&/$ .28</38<6:1504377;,0/3&*04I
*I
 6I
 -	I

 6I
 4I
 /I
 .I
 1I
 5I
 *I
 -I
 $I
 .I
 I
  
>!I
 t I
VMrM   rt  z
    XLM Model with a token classification head on top (a linear layer on top of the hidden-states output) e.g. for
    Named-Entity-Recognition (NER) tasks.
    c                       e Zd Z fdZe eej                  d             ee	e
e      	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                     ZddZ xZS )	TFXLMForTokenClassificationc                d   t        |   |g|i | |j                  | _        t        |d      | _        t
        j                  j                  |j                        | _        t
        j                  j                  |j                  t        |j                        d      | _        || _        y )Nr  r#  
classifierrR   )rY   rZ   rk  r   r  r   r`   rc   re   ra   r   rb   r  ri   r$  s       r7   rZ   z$TFXLMForTokenClassification.__init__  s    3&3F3 ++)&}E||++FNN;,,,,/&//2RYe - 
 rM   r&  r'  c                ,   | j                  |||||||||	|
|||      }|d   }| j                  ||      }| j                  |      }|dn| j                  ||      }|s|f|dd z   }||f|z   S |S t	        |||j
                  |j                        S )z
        labels (`tf.Tensor` of shape `(batch_size, sequence_length)`, *optional*):
            Labels for computing the token classification loss. Indices should be in `[0, ..., config.num_labels - 1]`.
        r+  r   r   Nr%   rm  )r  re   r  ro  r   r   r   )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   rp  r   r`  sequence_outputr  rn  ra  s                       r7   r   z TFXLMForTokenClassification.call  s    8 #..))%'/!5# / 
 .a0,,,J1~t4+?+?+OY!4QR!88F)-)9TGf$EvE&-;;*55	
 	
rM   c                   | j                   ry d| _         t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       et        j                  | j                  j
                        5  | j                  j                  d d | j                  j                  g       d d d        y y # 1 sw Y   |xY w# 1 sw Y   y xY w)NTr  r  )
r   r   r-   r   r  rT   r   r  ri   hidden_sizer   s     r7   r   z!TFXLMForTokenClassification.build      ::
4-9t//445 -  &&t,-4t,8t334 M%%tT4;;3J3J&KLM M 9- -M M   C"%3C."C+.C7rr  )r  r-  r  rd  r  rd  r  rd  r  rd  rE   rd  r   re  r   rd  r  rd  r_   rf  r   rf  r   rf  rp  rd  r   r0  r  z0Union[TFTokenClassifierOutput, Tuple[tf.Tensor]]rm   )r   r   r   rZ   r   r#   r1  r2  r!   r3  r   r4  r   r   r   r   s   @r7   r  r    s   	 *+?+F+FGd+ef&+$ .28</38<6:1504377;,0/3&*044
*4
 64
 -	4

 64
 44
 /4
 .4
 14
 54
 *4
 -4
 $4
 .4
 4
  
:!4
 g 4
l	MrM   r  z
    XLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear layer
    on top of the hidden-states output to compute `span start logits` and `span end logits`).
    c                       e Zd Z fdZe eej                  d             ee	e
e      	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 dd                     ZddZ xZS )	TFXLMForQuestionAnsweringSimplec                    t        |   |g|i | t        |d      | _        t        j
                  j                  |j                  t        |j                        d      | _
        || _        y )Nr  r#  
qa_outputsrR   )rY   rZ   r   r  r   r`   ra   rk  r   rb   r  ri   r$  s       r7   rZ   z(TFXLMForQuestionAnsweringSimple.__init__  sd    3&3F3)&}E,,,,/&//2RYe - 
 rM   r&  r'  c                   | j                  |||||||||	|
|||      }|d   }| j                  |      }t        j                  |dd      \  }}t        j                  |d      }t        j                  |d      }d}||d|i}||d<   | j                  |||f      }|s||f|d	d z   }||f|z   S |S t        ||||j                  |j                  
      S )a  
        start_positions (`tf.Tensor` of shape `(batch_size,)`, *optional*):
            Labels for position (index) of the start of the labelled span for computing the token classification loss.
            Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
            are not taken into account for computing the loss.
        end_positions (`tf.Tensor` of shape `(batch_size,)`, *optional*):
            Labels for position (index) of the end of the labelled span for computing the token classification loss.
            Positions are clamped to the length of the sequence (`sequence_length`). Position outside of the sequence
            are not taken into account for computing the loss.
        r+  r   r(   ru   r<   Nstart_positionend_positionr%   )rn  start_logits
end_logitsr   r   )	r  r  r-   splitsqueezero  r   r   r   )rh   r  r  r  r  r  rE   r   r   r  r_   r   r   start_positionsend_positionsr   r`  r  r  r  r  rn  rp  ra  s                           r7   r   z$TFXLMForQuestionAnsweringSimple.call  s'   F #..))%'/!5# / 
 .a01#%88FAB#? jzz,R8ZZ
4
&=+D&8F%2F>"''z0JKD"J/2Eab2IIF)-)9TGf$EvE-%!-;;*55
 	
rM   c                   | j                   ry d| _         t        | dd       Mt        j                  | j                  j
                        5  | j                  j                  d        d d d        t        | dd       et        j                  | j                  j
                        5  | j                  j                  d d | j                  j                  g       d d d        y y # 1 sw Y   |xY w# 1 sw Y   y xY w)NTr  r  )
r   r   r-   r   r  rT   r   r  ri   r  r   s     r7   r   z%TFXLMForQuestionAnsweringSimple.build8  r  r  )NNNNNNNNNNNNNNF) r  r-  r  rd  r  rd  r  rd  r  rd  rE   rd  r   re  r   rd  r  rd  r_   rf  r   rf  r   rf  r  rd  r  rd  r   r0  r  z7Union[TFQuestionAnsweringModelOutput, Tuple[tf.Tensor]]rm   )r   r   r   rZ   r   r#   r1  r2  r!   r3  r   r4  r   r   r   r   s   @r7   r  r    s4    *+?+F+FGd+ef&2$ .28</38<6:1504377;,0/3&*9=7;!B
*B
 6B
 -	B

 6B
 4B
 /B
 .B
 1B
 5B
 *B
 -B
 $B
 7B
 5B
  !B
" 
A#B
 g B
H	MrM   r  rm   )Ir  
__future__r   r   rR  dataclassesr   typingr   r   r   r   numpyr)   
tensorflowr-   activations_tfr
   modeling_tf_outputsr   r   r   r   r   modeling_tf_utilsr   r   r   r   r   r   r   r   r   r   r   r   tf_utilsr   r   r   utilsr   r    r!   r"   r#   r$   configuration_xlmr&   
get_loggerr   ry  r3  r4  r8   rL   r`   LayerrO   r   r   r  r  XLM_START_DOCSTRINGr1  r!  r6  rJ  rh  rt  r  r  rX   rM   r7   <module>r     s\   #   ! / /   /     S R  ) 
		H	%2 >:k;ell00 k;\?%,,,, ?> soU\\'' so sol	L, L2 4 4 42( TG T c4-% 4-	4-n0U\\'' 0f  W,/ W,W,t  O2%9;W O2O2d  |M13G |M|M~  RM"68Q RMRMj  ]M&:<S ]M]MrM   