
    g'                        d Z ddlZddlZddl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 ddl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
lmZmZmZmZ ddl m!Z! ddl"m#Z#  e!j$        e%          Z&dZ'dZ( G d de	j)                  Z*d<dZ+ G d de	j)                  Z, G d de	j)                  Z- G d de	j)                  Z. G d de	j)                  Z/ G d de	j)                  Z0 G d de	j)                  Z1 G d d e	j)                  Z2 G d! d"e	j)                  Z3 G d# d$e	j)                  Z4d%e4iZ5 G d& d'e	j)                  Z6 G d( d)e	j)                  Z7 G d* d+e	j)                  Z8 G d, d-e          Z9d.Z:d/Z; ed0e:           G d1 d2e9                      Z< ed3e:           G d4 d5e9                      Z= ed6e:           G d7 d8e9                      Z> ed9e:           G d: d;e9                      Z?dS )=zPyTorch MarkupLM model.    N)OptionalTupleUnion)nn)BCEWithLogitsLossCrossEntropyLossMSELoss   )ACT2FN)add_start_docstrings%add_start_docstrings_to_model_forwardreplace_return_docstrings))BaseModelOutputWithPastAndCrossAttentions,BaseModelOutputWithPoolingAndCrossAttentionsMaskedLMOutputQuestionAnsweringModelOutputSequenceClassifierOutputTokenClassifierOutput)PreTrainedModelapply_chunking_to_forward find_pruneable_heads_and_indicesprune_linear_layer)logging   )MarkupLMConfigzmicrosoft/markuplm-baser   c                   *     e Zd ZdZ fdZddZ xZS )XPathEmbeddingszConstruct the embeddings from xpath tags and subscripts.

    We drop tree-id in this version, as its info can be covered by xpath.
    c                    t          t          |                                            j        | _        t	          j        j        | j        z  j                  | _        t	          j	        j
                  | _        t	          j                    | _        t	          j        j        | j        z  dj        z            | _        t	          j        dj        z  j                  | _        t	          j        fdt#          | j                  D                       | _        t	          j        fdt#          | j                  D                       | _        d S )N   c                 N    g | ]!}t          j        j        j                  "S  )r   	Embeddingmax_xpath_tag_unit_embeddingsxpath_unit_hidden_size.0_configs     j/var/www/html/ai-engine/env/lib/python3.11/site-packages/transformers/models/markuplm/modeling_markuplm.py
<listcomp>z,XPathEmbeddings.__init__.<locals>.<listcomp>K   s;        VA6C`aa      c                 N    g | ]!}t          j        j        j                  "S r!   )r   r"   max_xpath_subs_unit_embeddingsr$   r%   s     r)   r*   z,XPathEmbeddings.__init__.<locals>.<listcomp>R   s;        VBFDabb  r+   )superr   __init__	max_depthr   Linearr$   hidden_sizexpath_unitseq2_embeddingsDropouthidden_dropout_probdropoutReLU
activationxpath_unitseq2_inner	inner2emb
ModuleListrangexpath_tag_sub_embeddingsxpath_subs_sub_embeddingsselfr(   	__class__s    `r)   r/   zXPathEmbeddings.__init__>   sE   ot$$--///))+63PSWSa3acicu)v)v&z&"<=='))$&If.Kdn.\^_bhbt^t$u$u!1v'9#96;MNN(*   t~..  )
 )
% *,   t~..  *
 *
&&&r+   Nc           	         g }g }t          | j                  D ]n}|                     | j        |         |d d d d |f                              |                     | j        |         |d d d d |f                              ot          j        |d          }t          j        |d          }||z   }|                     |                     | 	                    | 
                    |                                        }|S )Ndim)r<   r0   appendr=   r>   torchcatr:   r6   r8   r9   )r@   xpath_tags_seqxpath_subs_seqxpath_tags_embeddingsxpath_subs_embeddingsixpath_embeddingss          r)   forwardzXPathEmbeddings.forwardX   s'    " "t~&& 	e 	eA!(()I)Fq)I.YZYZYZ\]\]\]_`Y`Ja)b)bccc!(()J)G)J>Z[Z[Z[]^]^]^`aZaKb)c)cdddd %	*?R H H H %	*?R H H H03HH>>$,,ttG`G`aqGrGr7s7s*t*tuur+   )NN)__name__
__module____qualname____doc__r/   rO   __classcell__rA   s   @r)   r   r   8   sV         

 
 
 
 
4               r+   r   c                     |                      |                                          }t          j        |d                              |          |z   |z  }|                                |z   S )a  
    Replace non-padding symbols with their position numbers. Position numbers begin at padding_idx+1. Padding symbols
    are ignored. This is modified from fairseq's `utils.make_positions`.

    Args:
        x: torch.Tensor x:

    Returns: torch.Tensor
    r   rD   )neintrG   cumsumtype_aslong)	input_idspadding_idxpast_key_values_lengthmaskincremental_indicess        r)   "create_position_ids_from_input_idsra   k   sg     <<$$((**D <!444<<TBBE[[_cc##%%33r+   c                   >     e Zd ZdZ fdZd Z	 	 	 	 	 	 	 ddZ xZS )MarkupLMEmbeddingszGConstruct the embeddings from word, position and token_type embeddings.c                    t          t          |                                            || _        t	          j        |j        |j        |j                  | _	        t	          j        |j
        |j                  | _        |j        | _        t          |          | _        t	          j        |j        |j                  | _        t	          j        |j        |j                  | _        t	          j        |j                  | _        |                     dt/          j        |j
                                      d          d           |j        | _        t	          j        |j
        |j        | j                  | _        d S )N)r]   epsposition_ids)r   rC   F)
persistent)r.   rc   r/   r(   r   r"   
vocab_sizer2   pad_token_idword_embeddingsmax_position_embeddingsposition_embeddingsr0   r   rN   type_vocab_sizetoken_type_embeddings	LayerNormlayer_norm_epsr4   r5   r6   register_bufferrG   arangeexpandr]   r?   s     r)   r/   zMarkupLMEmbeddings.__init__~   sF    $''00222!|F,=v?Q_e_rsss#%<0NPVPb#c#c ) / 7 7%'\&2H&J\%]%]"f&8f>STTTz&"<==EL)GHHOOPWXXej 	 	
 	
 	
 ".#%<*F,>DL\$
 $
 $
   r+   c                    |                                 dd         }|d         }t          j        | j        dz   || j        z   dz   t          j        |j                  }|                    d                              |          S )z
        We are provided embeddings directly. We cannot infer which are padded so just generate sequential position ids.

        Args:
            inputs_embeds: torch.Tensor

        Returns: torch.Tensor
        NrC   r   dtypedevicer   )sizerG   rs   r]   r[   rx   	unsqueezert   )r@   inputs_embedsinput_shapesequence_lengthrg   s        r)   &create_position_ids_from_inputs_embedsz9MarkupLMEmbeddings.create_position_ids_from_inputs_embeds   s     $((**3B3/%a.|q /D4D"Dq"HPUPZcpcw
 
 
 %%a((//<<<r+   Nr   c                    ||                                 }n|                                 d d         }||j        n|j        }	|.|t          || j        |          }n|                     |          }|!t          j        |t
          j        |	          }||                     |          }|Q| j	        j
        t          j        t          t          |          | j        gz             t
          j        |	          z  }|Q| j	        j        t          j        t          t          |          | j        gz             t
          j        |	          z  }|}
|                     |          }|                     |          }|                     ||          }|
|z   |z   |z   }|                     |          }|                     |          }|S )NrC   rv   )ry   rx   ra   r]   r~   rG   zerosr[   rk   r(   
tag_pad_idonestuplelistr0   subs_pad_idrm   ro   rN   rp   r6   )r@   r\   rI   rJ   token_type_idsrg   r{   r^   r|   rx   words_embeddingsrm   ro   rN   
embeddingss                  r)   rO   zMarkupLMEmbeddings.forward   s     #..**KK',,..ss3K%.%:!!@T$A)TM]_uvv#JJ=YY!"[EJvVVVN  00;;M !![3ejd;''4>*::;;5:V\7 7 7 N !![4uzd;''4>*::;;5:V\8 8 8 N )"66|DD $ : :> J J00PP%(;;>SSVff
^^J//
\\*--
r+   )NNNNNNr   )rP   rQ   rR   rS   r/   r~   rO   rT   rU   s   @r)   rc   rc   {   sx        QQ
 
 
 
 
2= = =&  2 2 2 2 2 2 2 2r+   rc   c                   P     e Zd Z fdZdej        dej        dej        fdZ xZS )MarkupLMSelfOutputc                    t                                                       t          j        |j        |j                  | _        t          j        |j        |j                  | _        t          j        |j	                  | _
        d S Nre   )r.   r/   r   r1   r2   denserp   rq   r4   r5   r6   r?   s     r)   r/   zMarkupLMSelfOutput.__init__   sf    Yv163EFF
f&8f>STTTz&"<==r+   hidden_statesinput_tensorreturnc                     |                      |          }|                     |          }|                     ||z             }|S Nr   r6   rp   r@   r   r   s      r)   rO   zMarkupLMSelfOutput.forward   @    

=11]33}|'CDDr+   rP   rQ   rR   r/   rG   TensorrO   rT   rU   s   @r)   r   r      i        > > > > >U\  RWR^        r+   r   c                   B     e Zd Z fdZdej        dej        fdZ xZS )MarkupLMIntermediatec                    t                                                       t          j        |j        |j                  | _        t          |j        t                    rt          |j                 | _        d S |j        | _        d S r   )r.   r/   r   r1   r2   intermediate_sizer   
isinstance
hidden_actstrr   intermediate_act_fnr?   s     r)   r/   zMarkupLMIntermediate.__init__   sn    Yv163KLL
f'-- 	9'-f.?'@D$$$'-'8D$$$r+   r   r   c                 Z    |                      |          }|                     |          }|S r   )r   r   r@   r   s     r)   rO   zMarkupLMIntermediate.forward   s,    

=1100??r+   r   rU   s   @r)   r   r      s^        9 9 9 9 9U\ el        r+   r   c                   P     e Zd Z fdZdej        dej        dej        fdZ xZS )MarkupLMOutputc                    t                                                       t          j        |j        |j                  | _        t          j        |j        |j                  | _        t          j	        |j
                  | _        d S r   )r.   r/   r   r1   r   r2   r   rp   rq   r4   r5   r6   r?   s     r)   r/   zMarkupLMOutput.__init__   sf    Yv79KLL
f&8f>STTTz&"<==r+   r   r   r   c                     |                      |          }|                     |          }|                     ||z             }|S r   r   r   s      r)   rO   zMarkupLMOutput.forward  r   r+   r   rU   s   @r)   r   r      r   r+   r   c                   B     e Zd Z fdZdej        dej        fdZ xZS )MarkupLMPoolerc                     t                                                       t          j        |j        |j                  | _        t          j                    | _        d S r   )r.   r/   r   r1   r2   r   Tanhr8   r?   s     r)   r/   zMarkupLMPooler.__init__  sC    Yv163EFF
'))r+   r   r   c                 r    |d d df         }|                      |          }|                     |          }|S )Nr   )r   r8   )r@   r   first_token_tensorpooled_outputs       r)   rO   zMarkupLMPooler.forward  s@     +111a40

#56666r+   r   rU   s   @r)   r   r     s^        $ $ $ $ $
U\ el        r+   r   c                   B     e Zd Z fdZdej        dej        fdZ xZS )MarkupLMPredictionHeadTransformc                 V   t                                                       t          j        |j        |j                  | _        t          |j        t                    rt          |j                 | _
        n|j        | _
        t          j        |j        |j                  | _        d S r   )r.   r/   r   r1   r2   r   r   r   r   r   transform_act_fnrp   rq   r?   s     r)   r/   z(MarkupLMPredictionHeadTransform.__init__  s    Yv163EFF
f'-- 	6$*6+<$=D!!$*$5D!f&8f>STTTr+   r   r   c                     |                      |          }|                     |          }|                     |          }|S r   )r   r   rp   r   s     r)   rO   z'MarkupLMPredictionHeadTransform.forward&  s=    

=11--m<<}55r+   r   rU   s   @r)   r   r     sc        U U U U UU\ el        r+   r   c                   *     e Zd Z fdZd Zd Z xZS )MarkupLMLMPredictionHeadc                 >   t                                                       t          |          | _        t	          j        |j        |j        d          | _        t	          j	        t          j        |j                            | _        | j        | j        _        d S )NF)bias)r.   r/   r   	transformr   r1   r2   ri   decoder	ParameterrG   r   r   r?   s     r)   r/   z!MarkupLMLMPredictionHead.__init__/  sz    8@@ y!3V5FUSSSLV->!?!?@@	 !Ir+   c                 (    | j         | j        _         d S r   )r   r   r@   s    r)   _tie_weightsz%MarkupLMLMPredictionHead._tie_weights<  s     Ir+   c                 Z    |                      |          }|                     |          }|S r   )r   r   r   s     r)   rO   z MarkupLMLMPredictionHead.forward?  s*    }55]33r+   )rP   rQ   rR   r/   r   rO   rT   rU   s   @r)   r   r   .  sV        & & & & && & &      r+   r   c                   B     e Zd Z fdZdej        dej        fdZ xZS )MarkupLMOnlyMLMHeadc                 p    t                                                       t          |          | _        d S r   )r.   r/   r   predictionsr?   s     r)   r/   zMarkupLMOnlyMLMHead.__init__G  s/    3F;;r+   sequence_outputr   c                 0    |                      |          }|S r   )r   )r@   r   prediction_scoress      r)   rO   zMarkupLMOnlyMLMHead.forwardK  s     ,,_==  r+   r   rU   s   @r)   r   r   F  s^        < < < < <!u| ! ! ! ! ! ! ! ! !r+   r   c                   ,    e Zd Zd fd	Zdej        dej        fdZ	 	 	 	 	 	 ddej        deej                 d	eej                 d
eej                 deej                 dee	e	ej                                   dee
         de	ej                 fdZ xZS )MarkupLMSelfAttentionNc                 D   t                                                       |j        |j        z  dk    r0t	          |d          s t          d|j         d|j         d          |j        | _        t          |j        |j        z            | _        | j        | j        z  | _        t          j
        |j        | j                  | _        t          j
        |j        | j                  | _        t          j
        |j        | j                  | _        t          j        |j                  | _        |pt#          |dd          | _        | j        dk    s| j        d	k    r6|j        | _        t          j        d
|j        z  dz
  | j                  | _        |j        | _        d S )Nr   embedding_sizezThe hidden size (z6) is not a multiple of the number of attention heads ()position_embedding_typeabsoluterelative_keyrelative_key_query   r   )r.   r/   r2   num_attention_headshasattr
ValueErrorrX   attention_head_sizeall_head_sizer   r1   querykeyvaluer4   attention_probs_dropout_probr6   getattrr   rl   r"   distance_embedding
is_decoderr@   r(   r   rA   s      r)   r/   zMarkupLMSelfAttention.__init__R  s    ::a??PVXhHiHi?8F$6 8 8 48 8 8  
 $*#= #&v'9F<V'V#W#W !58PPYv143EFF
9V/1CDDYv143EFF
z&"EFF'> (
'-zC
 C
$ '>99T=Y]q=q=q+1+ID(&(l1v7U3UXY3Y[_[s&t&tD# +r+   xr   c                     |                                 d d         | j        | j        fz   }|                    |          }|                    dddd          S )NrC   r   r   r   r
   )ry   r   r   viewpermute)r@   r   new_x_shapes      r)   transpose_for_scoresz*MarkupLMSelfAttention.transpose_for_scoresl  sP    ffhhssmt'?AY&ZZFF;yyAq!$$$r+   Fr   attention_mask	head_maskencoder_hidden_statesencoder_attention_maskpast_key_valueoutput_attentionsc                 ^   |                      |          }|d u}	|	r||d         }
|d         }|}n4|	rS|                     |                     |                    }
|                     |                     |                    }|}n||                     |                     |                    }
|                     |                     |                    }t	          j        |d         |
gd          }
t	          j        |d         |gd          }nP|                     |                     |                    }
|                     |                     |                    }|                     |          }|d u}| j        r|
|f}t	          j        ||
                    dd                    }| j	        dk    s| j	        dk    rt|j
        d         |
j
        d         }}|r>t	          j        |dz
  t          j        |j        	                              dd          }n:t	          j        |t          j        |j        	                              dd          }t	          j        |t          j        |j        	                              dd          }||z
  }|                     || j        z   dz
            }|                    |j        
          }| j	        dk    rt	          j        d||          }||z   }n?| j	        dk    r4t	          j        d||          }t	          j        d|
|          }||z   |z   }|t+          j        | j                  z  }|||z   }t0          j                            |d          }|                     |          }|||z  }t	          j        ||          }|                    dddd                                          }|                                d d         | j        fz   }|                    |          }|r||fn|f}| j        r||fz   }|S )Nr   r   r   rD   rC   r   r   rv   rw   zbhld,lrd->bhlrzbhrd,lrd->bhlrr
   ) r   r   r   r   rG   rH   r   matmul	transposer   shapetensorr[   rx   r   rs   r   rl   torw   einsummathsqrtr   r   
functionalsoftmaxr6   r   
contiguousry   r   )r@   r   r   r   r   r   r   r   mixed_query_layeris_cross_attention	key_layervalue_layerquery_layer	use_cacheattention_scoresquery_length
key_lengthposition_ids_lposition_ids_rdistancepositional_embeddingrelative_position_scoresrelative_position_scores_queryrelative_position_scores_keyattention_probscontext_layernew_context_layer_shapeoutputss                               r)   rO   zMarkupLMSelfAttention.forwardq  sZ    !JJ}55
 3$> 	O."<&q)I(+K3NN 	O11$((;P2Q2QRRI33DJJ?T4U4UVVK3NN'11$((=2I2IJJI33DJJ}4M4MNNK	>!#4i"@aHHHI)^A%6$D!LLLKK11$((=2I2IJJI33DJJ}4M4MNNK//0ABB"$.	? 	6 (5N !<Y5H5HR5P5PQQ'>99T=Y]q=q=q'2'8';Y_Q=O*L w!&j1nEJWdWk!l!l!l!q!q" " "'l%*UbUi!j!j!j!o!oprtu!v!v"\*EJ}OcdddiijkmoppN%6H#'#:#:8dFb;bef;f#g#g #7#:#:AR#:#S#S +~==+0<8H+Wk+l+l(#36N#N  -1EEE16>NP[]q1r1r./4|<LiYm/n/n,#36T#TWs#s +di8P.Q.QQ%/.@ -//0@b/II ,,77  -	9O_kBB%--aAq99DDFF"/"4"4"6"6ss";t?Q>S"S%**+BCC6G]=/22mM]? 	2 11Gr+   r   NNNNNF)rP   rQ   rR   r/   rG   r   r   r   FloatTensorr   boolrO   rT   rU   s   @r)   r   r   Q  s.       , , , , , ,4%el %u| % % % % 7;15=A>BDH,1c c|c !!23c E-.	c
  ((9:c !)): ;c !uU->'?!@Ac $D>c 
u|	c c c c c c c cr+   r   eagerc                       e Zd Zd fd	Zd Z	 	 	 	 	 	 ddej        deej                 deej                 deej                 d	eej                 d
ee	e	ej                                   dee
         de	ej                 fdZ xZS )MarkupLMAttentionNc                     t                                                       t          |j                 ||          | _        t          |          | _        t                      | _        d S )Nr   )	r.   r/   MARKUPLM_SELF_ATTENTION_CLASSES_attn_implementationr@   r   outputsetpruned_headsr   s      r)   r/   zMarkupLMAttention.__init__  s`    3F4OP,C
 
 
	 )00EEr+   c                    t          |          dk    rd S t          || j        j        | j        j        | j                  \  }}t          | j        j        |          | j        _        t          | j        j        |          | j        _        t          | j        j	        |          | j        _	        t          | j
        j        |d          | j
        _        | j        j        t          |          z
  | j        _        | j        j        | j        j        z  | j        _        | j                            |          | _        d S )Nr   r   rD   )lenr   r@   r   r   r  r   r   r   r   r  r   r   union)r@   headsindexs      r)   prune_headszMarkupLMAttention.prune_heads  s    u::??F7490$)2OQUQb
 
u
 -TY_eDD	*49=%@@	,TY_eDD	.t{/@%QOOO )-	(EE

(R	%"&)"?$)B_"_	 -33E::r+   Fr   r   r   r   r   r   r   r   c           	          |                      |||||||          }|                     |d         |          }	|	f|dd          z   }
|
S )Nr   r   )r@   r  )r@   r   r   r   r   r   r   r   self_outputsattention_outputr	  s              r)   rO   zMarkupLMAttention.forward  sa     yy!"
 
  ;;|AFF#%QRR(88r+   r   r
  )rP   rQ   rR   r/   r  rG   r   r   r  r   r  rO   rT   rU   s   @r)   r  r    s       " " " " " "; ; ;* 7;15=A>BDH,1 | !!23 E-.	
  ((9: !)): ; !uU->'?!@A $D> 
u|	       r+   r  c                       e Zd Z fdZ	 	 	 	 	 	 ddej        deej                 deej                 deej                 deej                 d	eeeej                                   d
ee	         deej                 fdZ
d Z xZS )MarkupLMLayerc                    t                                                       |j        | _        d| _        t	          |          | _        |j        | _        |j        | _        | j        r/| j        st          |  d          t	          |d          | _	        t          |          | _        t          |          | _        d S )Nr   z> should be used as a decoder model if cross attention is addedr   r  )r.   r/   chunk_size_feed_forwardseq_len_dimr  	attentionr   add_cross_attentionr   crossattentionr   intermediater   r  r?   s     r)   r/   zMarkupLMLayer.__init__  s    '-'E$*622 +#)#= # 	`? j D!h!h!hiii"3FT^"_"_"_D088$V,,r+   NFr   r   r   r   r   r   r   r   c           	         |
|d d         nd }|                      |||||          }	|	d         }
| j        r|	dd         }|	d         }n
|	dd          }d }| j        rp|nt          | d          st          d|  d          |
|d	d          nd }|                     |
||||||          }|d         }
||dd         z   }|d         }||z   }t          | j        | j        | j        |
          }|f|z   }| j        r||fz   }|S )
Nr   )r   r   r   r   rC   r'  z'If `encoder_hidden_states` are passed, z` has to be instantiated with cross-attention layers by setting `config.add_cross_attention=True`r   )	r%  r   r   r   r'  r   feed_forward_chunkr#  r$  )r@   r   r   r   r   r   r   r   self_attn_past_key_valueself_attention_outputsr  r	  present_key_valuecross_attn_present_key_valuecross_attn_past_key_valuecross_attention_outputslayer_outputs                    r)   rO   zMarkupLMLayer.forward   s    :H9S>"1"#5#5Y] !%/3 "0 "
 "
 2!4 ? 	1,QrT2G 6r :,QRR0G'+$? 	Q4@4!122  Dd D D D   @N?Yrss(;(;_c%&*&9&9 %&)!' '#  7q9 7" ==G ,C2+F( 14P P0#T%A4CSUe
 
  /G+ ? 	5!2 44Gr+   c                 \    |                      |          }|                     ||          }|S r   )r(  r  )r@   r  intermediate_outputr1  s       r)   r*  z MarkupLMLayer.feed_forward_chunka  s2    "//0@AA{{#68HIIr+   r
  )rP   rQ   rR   r/   rG   r   r   r  r   r  rO   r*  rT   rU   s   @r)   r!  r!    s       - - - - -" 7;15=A>BDH,1? ?|? !!23? E-.	?
  ((9:? !)): ;? !uU->'?!@A? $D>? 
u|	? ? ? ?B      r+   r!  c                   L    e Zd Z fdZ	 	 	 	 	 	 	 	 	 ddej        deej                 deej                 deej                 d	eej                 d
eeeej                                   dee	         dee	         dee	         dee	         de
eej                 ef         fdZ xZS )MarkupLMEncoderc                     t                                                       | _        t          j        fdt          j                  D                       | _        d| _        d S )Nc                 .    g | ]}t                    S r!   )r!  r%   s     r)   r*   z,MarkupLMEncoder.__init__.<locals>.<listcomp>l  s!    #c#c#caM&$9$9#c#c#cr+   F)	r.   r/   r(   r   r;   r<   num_hidden_layerslayergradient_checkpointingr?   s    `r)   r/   zMarkupLMEncoder.__init__i  s`    ]#c#c#c#c5IaCbCb#c#c#cdd
&+###r+   NFTr   r   r   r   r   past_key_valuesr   r   output_hidden_statesreturn_dictr   c                    |	rdnd }|rdnd }|r| j         j        rdnd }| j        r%| j        r|rt                              d           d}|rdnd }t          | j                  D ]\  }}|	r||fz   }|||         nd }|||         nd }| j        r)| j        r"|                     |j	        |||||||          }n ||||||||          }|d         }|r||d         fz  }|r$||d         fz   }| j         j        r||d         fz   }|	r||fz   }|
st          d |||||fD                       S t          |||||	          S )
Nr!   zZ`use_cache=True` is incompatible with gradient checkpointing. Setting `use_cache=False`...Fr   rC   r   r   c              3      K   | ]}||V  	d S r   r!   )r&   vs     r)   	<genexpr>z*MarkupLMEncoder.forward.<locals>.<genexpr>  s4       
 
 =  !===
 
r+   )last_hidden_stater;  r   
attentionscross_attentions)r(   r&  r:  trainingloggerwarning_once	enumerater9  _gradient_checkpointing_func__call__r   r   )r@   r   r   r   r   r   r;  r   r   r<  r=  all_hidden_statesall_self_attentionsall_cross_attentionsnext_decoder_cacherM   layer_modulelayer_head_maskr   layer_outputss                       r)   rO   zMarkupLMEncoder.forwardo  sB    #7@BBD$5?bb4%6d4;;Zdrr`d& 	"4= 	" "##p   "	#,6RR$(44 #	V #	VOA|# I$58H$H!.7.CillO3B3N_Q//TXN* t}  $ A A )!"#)*"%	! 	! !-!"#)*"%! ! *!,M ;"}R'8&::"  V&9]1=M<O&O#;2 V+?=QRCSBU+U( 	E 1]4D D 	 
 
 "&%'(
 
 
 
 
 
 9+.+*1
 
 
 	
r+   )	NNNNNNFFT)rP   rQ   rR   r/   rG   r   r   r  r   r  r   r   rO   rT   rU   s   @r)   r5  r5  h  sD       , , , , , 7;15=A>BEI$(,1/4&*S
 S
|S
 !!23S
 E-.	S

  ((9:S
 !)): ;S
 "%e.?(@"ABS
 D>S
 $D>S
 'tnS
 d^S
 
uU\"$MM	NS
 S
 S
 S
 S
 S
 S
 S
r+   r5  c                   l     e Zd ZdZeZdZd Zede	e
eej        f                  f fd            Z xZS )MarkupLMPreTrainedModelz
    An abstract class to handle weights initialization and a simple interface for downloading and loading pretrained
    models.
    markuplmc                    t          |t          j                  rT|j        j                            d| j        j                   |j         |j        j        	                                 dS dS t          |t          j
                  r_|j        j                            d| j        j                   |j        +|j        j        |j                 	                                 dS dS t          |t          j                  r?|j        j        	                                 |j        j                            d           dS dS )zInitialize the weightsg        )meanstdN      ?)r   r   r1   weightdatanormal_r(   initializer_ranger   zero_r"   r]   rp   fill_)r@   modules     r)   _init_weightsz%MarkupLMPreTrainedModel._init_weights  s)   fbi(( 	* M&&CT[5R&SSS{& &&((((( '&-- 	*M&&CT[5R&SSS!-"6#56<<>>>>> .--- 	*K""$$$M$$S)))))	* 	*r+   pretrained_model_name_or_pathc                 L     t          t          |           j        |g|R i |S r   )r.   rS  from_pretrained)clsra  
model_argskwargsrA   s       r)   rc  z'MarkupLMPreTrainedModel.from_pretrained  sB    Bu,c22B)
,6
 
 
:@
 
 	
r+   )rP   rQ   rR   rS   r   config_classbase_model_prefixr`  classmethodr   r   r   osPathLikerc  rT   rU   s   @r)   rS  rS    s         
 "L"* * *  
HU3PRP[K[E\<] 
 
 
 
 
 [
 
 
 
 
r+   rS  aK  
    This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use
    it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and
    behavior.

    Parameters:
        config ([`MarkupLMConfig`]): 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 (`torch.LongTensor` of shape `({0})`):
            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)

        xpath_tags_seq (`torch.LongTensor` of shape `({0}, config.max_depth)`, *optional*):
            Tag IDs for each token in the input sequence, padded up to config.max_depth.

        xpath_subs_seq (`torch.LongTensor` of shape `({0}, config.max_depth)`, *optional*):
            Subscript IDs for each token in the input sequence, padded up to config.max_depth.

        attention_mask (`torch.FloatTensor` 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 MASKED tokens.

            [What are attention masks?](../glossary#attention-mask)
        token_type_ids (`torch.LongTensor` 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 (`torch.LongTensor` 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)
        head_mask (`torch.FloatTensor` 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 (`torch.FloatTensor` of shape `(batch_size, 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.
        output_attentions (`bool`, *optional*):
            If set to `True`, the attentions tensors of all attention layers are returned. See `attentions` under
            returned tensors for more detail.
        output_hidden_states (`bool`, *optional*):
            If set to `True`, the hidden states of all layers are returned. See `hidden_states` under returned tensors
            for more detail.
        return_dict (`bool`, *optional*):
            If set to `True`, the model will return a [`~file_utils.ModelOutput`] instead of a plain tuple.
zbThe bare MarkupLM Model transformer outputting raw hidden-states without any specific head on top.c                       e Zd Zd fd	Zd Zd Zd Z ee	                    d                     e
ee          	 	 	 	 	 	 	 	 	 	 	 dd	eej                 d
eej                 deej                 deej                 deej                 deej                 deej                 deej                 dee         dee         dee         deeef         fd                        Zd Z xZS )MarkupLMModelTc                     t                                          |           || _        t          |          | _        t          |          | _        |rt          |          nd | _        | 	                                 d S r   )
r.   r/   r(   rc   r   r5  encoderr   pooler	post_init)r@   r(   add_pooling_layerrA   s      r)   r/   zMarkupLMModel.__init__(  sq       ,V44&v..0AKnV,,,t 	r+   c                     | j         j        S r   r   rk   r   s    r)   get_input_embeddingsz"MarkupLMModel.get_input_embeddings4  s    ..r+   c                     || j         _        d S r   rt  )r@   r   s     r)   set_input_embeddingsz"MarkupLMModel.set_input_embeddings7  s    */'''r+   c                     |                                 D ]/\  }}| j        j        |         j                            |           0dS )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
        N)itemsro  r9  r%  r  )r@   heads_to_pruner9  r  s       r)   _prune_headszMarkupLMModel._prune_heads:  sU    
 +0022 	C 	CLE5Lu%/;;EBBBB	C 	Cr+   batch_size, sequence_lengthoutput_typerg  Nr\   rI   rJ   r   r   rg   r   r{   r   r<  r=  r   c                    |	|	n| j         j        }	|
|
n| j         j        }
||n| j         j        }||t	          d          |+|                     ||           |                                }n.||                                dd         }nt	          d          ||j        n|j        }|t          j	        ||          }|!t          j
        |t          j        |          }|                    d                              d          }|                    | j        	          }d
|z
  dz  }||                                dk    rr|                    d                              d                              d                              d          }|                    | j         j        dddd          }nS|                                dk    r;|                    d                              d                              d          }|                    t%          |                                           j        	          }ndg| j         j        z  }|                     ||||||          }|                     ||||	|
|          }|d         }| j        |                     |          nd}|s||f|dd         z   S t/          |||j        |j        |j                  S )a`  
        Returns:

        Examples:

        ```python
        >>> from transformers import AutoProcessor, MarkupLMModel

        >>> processor = AutoProcessor.from_pretrained("microsoft/markuplm-base")
        >>> model = MarkupLMModel.from_pretrained("microsoft/markuplm-base")

        >>> html_string = "<html> <head> <title>Page Title</title> </head> </html>"

        >>> encoding = processor(html_string, return_tensors="pt")

        >>> outputs = model(**encoding)
        >>> last_hidden_states = outputs.last_hidden_state
        >>> list(last_hidden_states.shape)
        [1, 4, 768]
        ```NzDYou cannot specify both input_ids and inputs_embeds at the same timerC   z5You have to specify either input_ids or inputs_embeds)rx   rv   r   r   r   rX  g     r   )r\   rI   rJ   rg   r   r{   )r   r   r<  r=  )rB  pooler_outputr   rC  rD  )r(   r   r<  use_return_dictr   %warn_if_padding_and_no_attention_maskry   rx   rG   r   r   r[   rz   r   rw   rE   rt   r8  next
parametersr   ro  rp  r   r   rC  rD  )r@   r\   rI   rJ   r   r   rg   r   r{   r   r<  r=  r|   rx   extended_attention_maskembedding_outputencoder_outputsr   r   s                      r)   rO   zMarkupLMModel.forwardB  s'   H 2C1N--TXT_Tq$8$D  $+Jj 	 &1%<kk$+B] ]%>cddd"66y.QQQ#..**KK&',,..ss3KKTUUU%.%:!!@T!"ZFCCCN!"[EJvVVVN"0":":1"="="G"G"J"J"9"<"<4:"<"N"N#&)@#@H"L }}!##%//22<<Q??II"MMWWXZ[[	%,,T[-JBPRTVXZ[[		A%%%//22<<R@@JJ2NN	!40A0A+B+B+HIIII!>>I??))%)' + 
 
 ,,#/!5# ' 
 
 *!,8<8OO444UY 	J#]3oabb6III;-')7&1,=
 
 
 	
r+   c                 T    d}|D ]!}|t          fd|D                       fz  }"|S )Nr!   c              3   t   K   | ]2}|                     d                     |j                            V  3dS )r   N)index_selectr   rx   )r&   
past_statebeam_idxs     r)   rA  z/MarkupLMModel._reorder_cache.<locals>.<genexpr>  sC      nnU_j--aZ=N1O1OPPnnnnnnr+   )r   )r@   r;  r  reordered_past
layer_pasts     `  r)   _reorder_cachezMarkupLMModel._reorder_cache  sQ    ) 	 	Jnnnncmnnnnn NN r+   )T)NNNNNNNNNNN)rP   rQ   rR   r/   ru  rw  r{  r   MARKUPLM_INPUTS_DOCSTRINGformatr   r   _CONFIG_FOR_DOCr   rG   
LongTensorr  r  r   r   rO   r  rT   rU   s   @r)   rm  rm  "  s       
 
 
 
 
 
/ / /0 0 0C C C +*+D+K+KLi+j+jkk+Wfuvvv 1559596:59371559,0/3&*e
 e
E,-e
 !!12e
 !!12	e

 !!23e
 !!12e
 u/0e
 E-.e
   12e
 $D>e
 'tne
 d^e
 
uBB	Ce
 e
 e
 wv lke
P      r+   rm  z
    MarkupLM Model with a span classification head on top for extractive question-answering tasks like SQuAD (a linear
    layers 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                    d                     eee	          	 	 	 	 	 	 	 	 	 	 	 	 	 dde
ej                 de
ej                 de
ej                 de
ej                 d	e
ej                 d
e
ej                 de
ej                 de
ej                 de
ej                 de
ej                 de
e         de
e         de
e         deeej                 ef         fd                        Z xZS )MarkupLMForQuestionAnsweringc                     t                                          |           |j        | _        t          |d          | _        t          j        |j        |j                  | _        | 	                                 d S NF)rr  )
r.   r/   
num_labelsrm  rT  r   r1   r2   
qa_outputsrq  r?   s     r)   r/   z%MarkupLMForQuestionAnswering.__init__  sj        +%fFFF)F$68IJJ 	r+   r|  r}  Nr\   rI   rJ   r   r   rg   r   r{   start_positionsend_positionsr   r<  r=  r   c                    ||n| j         j        }|                     |||||||||||          }|d         }|                     |          }|                    dd          \  }}|                    d                                          }|                    d                                          }d}|	|
t          |	                                          dk    r|	                    d          }	t          |
                                          dk    r|
                    d          }
|                    d          }|		                    d|           |
	                    d|           t          |          } |||	          } |||
          }||z   dz  }|s||f|dd         z   }||f|z   n|S t          ||||j        |j        	          S )
a  
        start_positions (`torch.LongTensor` 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 (`torch.LongTensor` 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.

        Returns:

        Examples:

        ```python
        >>> from transformers import AutoProcessor, MarkupLMForQuestionAnswering
        >>> import torch

        >>> processor = AutoProcessor.from_pretrained("microsoft/markuplm-base-finetuned-websrc")
        >>> model = MarkupLMForQuestionAnswering.from_pretrained("microsoft/markuplm-base-finetuned-websrc")

        >>> html_string = "<html> <head> <title>My name is Niels</title> </head> </html>"
        >>> question = "What's his name?"

        >>> encoding = processor(html_string, questions=question, return_tensors="pt")

        >>> with torch.no_grad():
        ...     outputs = model(**encoding)

        >>> answer_start_index = outputs.start_logits.argmax()
        >>> answer_end_index = outputs.end_logits.argmax()

        >>> predict_answer_tokens = encoding.input_ids[0, answer_start_index : answer_end_index + 1]
        >>> processor.decode(predict_answer_tokens).strip()
        'Niels'
        ```N
rI   rJ   r   r   rg   r   r{   r   r<  r=  r   r   rC   rD   )ignore_indexr   )lossstart_logits
end_logitsr   rC  )r(   r  rT  r  splitsqueezer   r  ry   clamp_r   r   r   rC  )r@   r\   rI   rJ   r   r   rg   r   r{   r  r  r   r<  r=  r	  r   logitsr  r  
total_lossignored_indexloss_fct
start_lossend_lossr  s                            r)   rO   z$MarkupLMForQuestionAnswering.forward  s   l &1%<kk$+B]--))))%'/!5#   
 
 "!*11#)<<r<#:#: j#++B//::<<''++6688

&=+D?''))**Q.."1"9"9""="==%%''((1,, - 5 5b 9 9(--a00M""1m444  M222']CCCH!,@@Jx
M::H$x/14J 	R"J/'!""+=F/9/EZMF**6Q+%!!/)
 
 
 	
r+   )NNNNNNNNNNNNN)rP   rQ   rR   r/   r   r  r  r   r   r  r   rG   r   r  r   r   rO   rT   rU   s   @r)   r  r    s            +*+D+K+KLi+j+jkk+GVefff -115151515/3,0042604,0/3&*f
 f
EL)f
 !.f
 !.	f

 !.f
 !.f
 u|,f
 EL)f
  -f
 "%,/f
  -f
 $D>f
 'tnf
 d^f
 
uU\"$@@	Af
 f
 f
 gf lkf
 f
 f
 f
 f
r+   r  z9MarkupLM Model with a `token_classification` head on top.c                       e Zd Z fdZ ee                    d                     eee	          	 	 	 	 	 	 	 	 	 	 	 	 dde
ej                 de
ej                 de
ej                 de
ej                 d	e
ej                 d
e
ej                 de
ej                 de
ej                 de
ej                 de
e         de
e         de
e         deeej                 ef         fd                        Z xZS )MarkupLMForTokenClassificationc                 Z   t                                          |           |j        | _        t          |d          | _        |j        |j        n|j        }t          j        |          | _	        t          j
        |j        |j                  | _        |                                  d S r  )r.   r/   r  rm  rT  classifier_dropoutr5   r   r4   r6   r1   r2   
classifierrq  r@   r(   r  rA   s      r)   r/   z'MarkupLMForTokenClassification.__init__6  s        +%fFFF)/)B)NF%%TZTn 	 z"455)F$68IJJ 	r+   r|  r}  Nr\   rI   rJ   r   r   rg   r   r{   labelsr   r<  r=  r   c                    ||n| j         j        }|                     |||||||||
||          }|d         }|                     |          }d}|	Kt	                      } ||                    d| j         j                  |	                    d                    }|s|f|dd         z   }||f|z   n|S t          |||j        |j	                  S )a  
        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]`.

        Returns:

        Examples:

        ```python
        >>> from transformers import AutoProcessor, AutoModelForTokenClassification
        >>> import torch

        >>> processor = AutoProcessor.from_pretrained("microsoft/markuplm-base")
        >>> processor.parse_html = False
        >>> model = AutoModelForTokenClassification.from_pretrained("microsoft/markuplm-base", num_labels=7)

        >>> nodes = ["hello", "world"]
        >>> xpaths = ["/html/body/div/li[1]/div/span", "/html/body/div/li[1]/div/span"]
        >>> node_labels = [1, 2]
        >>> encoding = processor(nodes=nodes, xpaths=xpaths, node_labels=node_labels, return_tensors="pt")

        >>> with torch.no_grad():
        ...     outputs = model(**encoding)

        >>> loss = outputs.loss
        >>> logits = outputs.logits
        ```Nr  r   rC   r   r  r  r   rC  )
r(   r  rT  r  r   r   r  r   r   rC  )r@   r\   rI   rJ   r   r   rg   r   r{   r  r   r<  r=  r	  r   r   r  r  r  s                      r)   rO   z&MarkupLMForTokenClassification.forwardD  s   X &1%<kk$+B]--))))%'/!5#   
 
 "!* OOO<<'))H8!&&r4;+ABBB D
  	F')GABBK7F)-)9TGf$$vE$$!/)	
 
 
 	
r+   NNNNNNNNNNNN)rP   rQ   rR   r/   r   r  r  r   r   r  r   rG   r   r  r   r   rO   rT   rU   s   @r)   r  r  3  s            +*+D+K+KLi+j+jkk>XXX -115151515/3,004)-,0/3&*N
 N
EL)N
 !.N
 !.	N

 !.N
 !.N
 u|,N
 EL)N
  -N
 &N
 $D>N
 'tnN
 d^N
 
uU\"N2	3N
 N
 N
 YX lkN
 N
 N
 N
 N
r+   r  z
    MarkupLM Model transformer 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                    d                     eee	          	 	 	 	 	 	 	 	 	 	 	 	 dde
ej                 de
ej                 de
ej                 de
ej                 d	e
ej                 d
e
ej                 de
ej                 de
ej                 de
ej                 de
e         de
e         de
e         deeej                 ef         fd                        Z xZS )!MarkupLMForSequenceClassificationc                 d   t                                          |           |j        | _        || _        t	          |          | _        |j        |j        n|j        }t          j	        |          | _
        t          j        |j        |j                  | _        |                                  d S r   )r.   r/   r  r(   rm  rT  r  r5   r   r4   r6   r1   r2   r  rq  r  s      r)   r/   z*MarkupLMForSequenceClassification.__init__  s        +%f--)/)B)NF%%TZTn 	 z"455)F$68IJJ 	r+   r|  r}  Nr\   rI   rJ   r   r   rg   r   r{   r  r   r<  r=  r   c                    ||n| j         j        }|                     |||||||||
||          }|d         }|                     |          }|                     |          }d}|	Z| j         j        f| j        dk    rd| j         _        nN| j        dk    r7|	j        t          j	        k    s|	j        t          j
        k    rd| j         _        nd| j         _        | j         j        dk    rWt                      }| j        dk    r1 ||                                |	                                          }n |||	          }n| j         j        dk    rGt                      } ||                    d| j                  |	                    d                    }n*| j         j        dk    rt                      } |||	          }|s|f|dd         z   }||f|z   n|S t!          |||j        |j        	          S )
a&  
        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).

        Returns:

        Examples:

        ```python
        >>> from transformers import AutoProcessor, AutoModelForSequenceClassification
        >>> import torch

        >>> processor = AutoProcessor.from_pretrained("microsoft/markuplm-base")
        >>> model = AutoModelForSequenceClassification.from_pretrained("microsoft/markuplm-base", num_labels=7)

        >>> html_string = "<html> <head> <title>Page Title</title> </head> </html>"
        >>> encoding = processor(html_string, return_tensors="pt")

        >>> with torch.no_grad():
        ...     outputs = model(**encoding)

        >>> loss = outputs.loss
        >>> logits = outputs.logits
        ```Nr  r   
regressionsingle_label_classificationmulti_label_classificationrC   r   r  )r(   r  rT  r6   r  problem_typer  rw   rG   r[   rX   r	   r  r   r   r   r   r   rC  )r@   r\   rI   rJ   r   r   rg   r   r{   r  r   r<  r=  r	  r   r  r  r  r  s                      r)   rO   z)MarkupLMForSequenceClassification.forward  s#   V &1%<kk$+B]--))))%'/!5#   
 
  
]33//{'/?a''/;DK,,_q((flej.H.HFL\a\eLeLe/LDK,,/KDK,{'<77"99?a''#8FNN$4$4fnn6F6FGGDD#8FF33DD)-JJJ+--xB @ @&++b//RR)-III,..x// 	FY,F)-)9TGf$$vE'!/)	
 
 
 	
r+   r  )rP   rQ   rR   r/   r   r  r  r   r   r  r   rG   r   r  r   r   rO   rT   rU   s   @r)   r  r    s            +*+D+K+KLi+j+jkk+CRabbb -115151515/3,004)-,0/3&*]
 ]
EL)]
 !.]
 !.	]

 !.]
 !.]
 u|,]
 EL)]
  -]
 &]
 $D>]
 'tn]
 d^]
 
uU\"$<<	=]
 ]
 ]
 cb lk]
 ]
 ]
 ]
 ]
r+   r  )r   )@rS   r   rj  typingr   r   r   rG   torch.utils.checkpointr   torch.nnr   r   r	   activationsr   
file_utilsr   r   r   modeling_outputsr   r   r   r   r   r   modeling_utilsr   r   r   r   utilsr   configuration_markuplmr   
get_loggerrP   rF  _CHECKPOINT_FOR_DOCr  Moduler   ra   rc   r   r   r   r   r   r   r   r   r  r  r!  r5  rS  MARKUPLM_START_DOCSTRINGr  rm  r  r  r  r!   r+   r)   <module>r     s      				 ) ) ) ) ) ) ) ) ) )            A A A A A A A A A A ! ! ! ! ! !         
                                 2 2 2 2 2 2 
	H	%	%/ "/  /  /  /  / bi /  /  / f4 4 4 4 _ _ _ _ _ _ _ _F           29        RY       RY        bi   $    ry   0! ! ! ! !") ! ! !C C C C CBI C C CN "# 0 0 0 0 0	 0 0 0hS S S S SBI S S SnZ
 Z
 Z
 Z
 Z
bi Z
 Z
 Z
z
 
 
 
 
o 
 
 
B	 . b h L L L L L+ L L	 L^   t
 t
 t
 t
 t
#: t
 t
 t
n UWopp`
 `
 `
 `
 `
%< `
 `
 qp`
F   p
 p
 p
 p
 p
(? p
 p
 p
 p
 p
r+   