
    Z j                         S SK Jr  SSKJr  SSKJrJr  \" 5       (       a  S SKr\" SS9\ " S S	\5      5       5       rS	/r	g)
    )strict   )PreTrainedConfig)auto_docstringis_detectron2_availableNzmicrosoft/layoutxlm-base)
checkpointc                     ^  \ rS rSr% SrSrSr\\S'   Sr	\\S'   Sr
\\S	'   Sr\\S
'   Sr\\S'   Sr\\S'   Sr\\-  \S'   Sr\\-  \S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\\S'   Sr\S-  \S'   Sr\\S'   Sr\\S '   S!r\\S"'   S#r\\S$'   S%r\\S&'   S'r\\S('   S#r\\S)'   S*r\ \   \!\S+4   -  \S,'   Sr"\\S-'   Sr#\\S.'   S#r$\\S/'   S#r%\\S0'   S1r&\\S2'   Sr'\(S-  \S3'   U 4S4 jr)\*S5 5       r+S6 r,S7r-U =r.$ )8LayoutXLMConfig!   a	  
max_2d_position_embeddings (`int`, *optional*, defaults to 1024):
    The maximum value that the 2D position embedding might ever be used with. Typically set this to something
    large just in case (e.g., 1024).
max_rel_pos (`int`, *optional*, defaults to 128):
    The maximum number of relative positions to be used in the self-attention mechanism.
rel_pos_bins (`int`, *optional*, defaults to 32):
    The number of relative position bins to be used in the self-attention mechanism.
fast_qkv (`bool`, *optional*, defaults to `True`):
    Whether or not to use a single matrix for the queries, keys, values in the self-attention layers.
max_rel_2d_pos (`int`, *optional*, defaults to 256):
    The maximum number of relative 2D positions in the self-attention mechanism.
rel_2d_pos_bins (`int`, *optional*, defaults to 64):
    The number of 2D relative position bins in the self-attention mechanism.
convert_sync_batchnorm (`bool`, *optional*, defaults to `True`):
    Whether or not to convert batch normalization layers to synchronized batch normalization layers.
image_feature_pool_shape (`list[int]`, *optional*, defaults to `[7, 7, 256]`):
    The shape of the average-pooled feature map.
coordinate_size (`int`, *optional*, defaults to 128):
    Dimension of the coordinate embeddings.
shape_size (`int`, *optional*, defaults to 128):
    Dimension of the width and height embeddings.
has_relative_attention_bias (`bool`, *optional*, defaults to `True`):
    Whether or not to use a relative attention bias in the self-attention mechanism.
has_spatial_attention_bias (`bool`, *optional*, defaults to `True`):
    Whether or not to use a spatial attention bias in the self-attention mechanism.
has_visual_segment_embedding (`bool`, *optional*, defaults to `False`):
    Whether or not to add visual segment embeddings.
detectron2_config_args (`dict`, *optional*):
    Dictionary containing the configuration arguments of the Detectron2 visual backbone. Refer to [this
    file](https://github.com/microsoft/unilm/blob/master/layoutlmft/layoutlmft/models/layoutxlm/detectron2_config.py)
    for details regarding default values.

Example:

```python
>>> from transformers import LayoutXLMConfig, LayoutXLMModel

>>> # Initializing a LayoutXLM microsoft/layoutxlm-base style configuration
>>> configuration = LayoutXLMConfig()

>>> # Initializing a model (with random weights) from the microsoft/layoutxlm-base style configuration
>>> model = LayoutXLMModel(configuration)

>>> # Accessing the model configuration
>>> configuration = model.config
```	layoutxlmi:w  
vocab_sizei   hidden_size   num_hidden_layersnum_attention_headsi   intermediate_sizegelu
hidden_actg?hidden_dropout_probattention_probs_dropout_prob   max_position_embeddings   type_vocab_sizeg{Gz?initializer_rangeg-q=layer_norm_epsr   Npad_token_idi   max_2d_position_embeddings   max_rel_pos    rel_pos_binsTfast_qkv   max_rel_2d_pos@   rel_2d_pos_binsconvert_sync_batchnorm)   r)   r$   .image_feature_pool_shapecoordinate_size
shape_sizehas_relative_attention_biashas_spatial_attention_biasFhas_visual_segment_embeddingdetectron2_config_argsc                    > [         TU ]  " S0 UD6  U R                  b  U R                  U l        g U R                  5       U l        g )N )super__post_init__r0   get_default_detectron2_config)selfkwargs	__class__s     چ/root/GenerationalWealth/GenerationalWealth/venv/lib/python3.13/site-packages/transformers/models/layoutxlm/configuration_layoutxlm.pyr4   LayoutXLMConfig.__post_init__r   sJ    '' **6 '' 	# 335 	#    c                     0 SS_S/ SQ_SS_S/ SQ_S	S
/S/S/S/S//_S/ SQ_SS_SS_SS_SS_SS_SS_S/ SQ_SS_SS _S!S"_S#S$_S%S&S'S
/S/S/S/S/// S(Q// SQS
S)S*S+.	E$ ),NzMODEL.MASK_ONTzMODEL.PIXEL_STD)g     L@g(\L@g(\2M@zMODEL.BACKBONE.NAMEbuild_resnet_fpn_backbonezMODEL.FPN.IN_FEATURES)res2res3res4res5zMODEL.ANCHOR_GENERATOR.SIZESr!   r&   r   r$   r   zMODEL.RPN.IN_FEATURES)p2p3p4p5p6zMODEL.RPN.PRE_NMS_TOPK_TRAINi  zMODEL.RPN.PRE_NMS_TOPK_TESTi  zMODEL.RPN.POST_NMS_TOPK_TRAINzMODEL.POST_NMS_TOPK_TESTzMODEL.ROI_HEADS.NAMEStandardROIHeadszMODEL.ROI_HEADS.NUM_CLASSES   zMODEL.ROI_HEADS.IN_FEATURES)rB   rC   rD   rE   zMODEL.ROI_BOX_HEAD.NAMEFastRCNNConvFCHeadzMODEL.ROI_BOX_HEAD.NUM_FCr   z$MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION   zMODEL.ROI_MASK_HEAD.NAMEMaskRCNNConvUpsampleHead   r)   e   )g      ?g      ?g       @   F)	zMODEL.ROI_MASK_HEAD.NUM_CONVz%MODEL.ROI_MASK_HEAD.POOLER_RESOLUTIONzMODEL.RESNETS.DEPTHzMODEL.RESNETS.SIZESzMODEL.RESNETS.ASPECT_RATIOSzMODEL.RESNETS.OUT_FEATURESzMODEL.RESNETS.NUM_GROUPSzMODEL.RESNETS.WIDTH_PER_GROUPzMODEL.RESNETS.STRIDE_IN_1X1r2   )clss    r9   r5   -LayoutXLMConfig.get_default_detectron2_configz   s+   
T
7
 "#>
 $%E	

 +bTB4#u,M
 $%C
 +D
 *4
 ,T
 '
 #$6
 *1
 *+C
 &';
 (
  3B!
" '(B#
$ -.56#&%'D2$use#D,;+<*J(*-.+05
 	
r;   c                     [         R                  R                  5       nU R                  R	                  5        H>  u  p#UR                  S5      nUnUS S  H  n[        XV5      nM     [        XTS   U5        M@     U$ )N.)
detectron2configget_cfgr0   itemssplitgetattrsetattr)r6   detectron2_configkv
attributesto_set	attributes          r9   get_detectron2_config%LayoutXLMConfig.get_detectron2_config   st    &--557//557DAJ&F'_	 3 -FrNA. 8 ! r;   )r0   )/__name__
__module____qualname____firstlineno____doc__
model_typer   int__annotations__r   r   r   r   r   strr   floatr   r   r   r   r   r   r   r    r"   r#   boolr%   r'   r(   r*   listtupler+   r,   r-   r.   r/   r0   dictr4   classmethodr5   ra   __static_attributes____classcell__)r8   s   @r9   r
   r
   !   sp   .` JJKs!!!s!J'**03 %#+3#&S&OS#u#!NE! L#* &**KL#HdNCOS#'D'<Gd3i%S/9GOSJ(,,'++). $.*.D4K.
 
 
<	! 	!r;   r
   )
huggingface_hub.dataclassesr   configuration_utilsr   utilsr   r   rT   r
   __all__r2   r;   r9   <module>rx      sV   , / 3 <  56!& !  7!D 
r;   