






"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCamelCase_	:				Union[str, Any]										= logging.get_logger(__name__)

UpperCamelCase_	:				Optional[int]										= {
    """xlm-mlm-en-2048""": """https://huggingface.co/xlm-mlm-en-2048/resolve/main/config.json""",
    """xlm-mlm-ende-1024""": """https://huggingface.co/xlm-mlm-ende-1024/resolve/main/config.json""",
    """xlm-mlm-enfr-1024""": """https://huggingface.co/xlm-mlm-enfr-1024/resolve/main/config.json""",
    """xlm-mlm-enro-1024""": """https://huggingface.co/xlm-mlm-enro-1024/resolve/main/config.json""",
    """xlm-mlm-tlm-xnli15-1024""": """https://huggingface.co/xlm-mlm-tlm-xnli15-1024/resolve/main/config.json""",
    """xlm-mlm-xnli15-1024""": """https://huggingface.co/xlm-mlm-xnli15-1024/resolve/main/config.json""",
    """xlm-clm-enfr-1024""": """https://huggingface.co/xlm-clm-enfr-1024/resolve/main/config.json""",
    """xlm-clm-ende-1024""": """https://huggingface.co/xlm-clm-ende-1024/resolve/main/config.json""",
    """xlm-mlm-17-1280""": """https://huggingface.co/xlm-mlm-17-1280/resolve/main/config.json""",
    """xlm-mlm-100-1280""": """https://huggingface.co/xlm-mlm-100-1280/resolve/main/config.json""",
}


class      _lowercase (     __A						):
      _a   :     str								=   '''xlm'''
      _a   :     Optional[int]								=   {
          '''hidden_size''': '''emb_dim''',
          '''num_attention_heads''': '''n_heads''',
          '''num_hidden_layers''': '''n_layers''',
          '''n_words''': '''vocab_size''',  # For backward compatibility
      }


      def __init__(    self				:	List[Any]							,   a				:	Tuple=3_0_1_4_5							,   a				:	Dict=2_0_4_8							,   a				:	Optional[Any]=1_2							,   a				:	str=1_6							,   a				:	int=0.1							,   a				:	Tuple=0.1							,   a				:	List[str]=True							,   a				:	int=False							,   a				:	Tuple=False							,   a				:	List[Any]=False							,   a				:	List[str]=1							,   a				:	Tuple=True							,   a				:	Optional[Any]=5_1_2							,   a				:	Optional[int]=2_0_4_8**-0.5							,   a				:	Any=1e-12							,   a				:	str=0.0_2							,   a				:	List[Any]=0							,   a				:	Tuple=1							,   a				:	List[str]=2							,   a				:	List[Any]=3							,   a				:	int=5							,   a				:	Any=True							,   a				:	Tuple="first"							,   a				:	Any=True							,   a				:	List[str]=None							,   a				:	Dict=True							,   a				:	Optional[int]=0.1							,   a				:	List[Any]=5							,   a				:	str=5							,   a				:	int=0							,   a				:	int=0							,   a				:	List[str]=2							,   a				:	Tuple=0							,   **a				:	Tuple							,   ):





            """simple docstring"""







            __snake_case      :    str  			=vocab_size
            __snake_case      :    int  			=emb_dim
            __snake_case      :    str  			=n_layers
            __snake_case      :    str  			=n_heads
            __snake_case      :    Optional[int]  			=dropout
            __snake_case      :    int  			=attention_dropout
            __snake_case      :    int  			=gelu_activation
            __snake_case      :    List[Any]  			=sinusoidal_embeddings
            __snake_case      :    Any  			=causal
            __snake_case      :    Any  			=asm
            __snake_case      :    Optional[Any]  			=n_langs
            __snake_case      :    Union[str, Any]  			=use_lang_emb
            __snake_case      :    Dict  			=layer_norm_eps
            __snake_case      :    Any  			=bos_index
            __snake_case      :    Any  			=eos_index
            __snake_case      :    Optional[Any]  			=pad_index
            __snake_case      :    str  			=unk_index
            __snake_case      :    Optional[int]  			=mask_index
            __snake_case      :    List[Any]  			=is_encoder
            __snake_case      :    str  			=max_position_embeddings
            __snake_case      :    List[Any]  			=embed_init_std
            __snake_case      :    str  			=init_std
            __snake_case      :    Optional[Any]  			=summary_type
            __snake_case      :    Optional[int]  			=summary_use_proj
            __snake_case      :    Any  			=summary_activation
            __snake_case      :    Optional[Any]  			=summary_proj_to_labels
            __snake_case      :    List[Any]  			=summary_first_dropout
            __snake_case      :    int  			=start_n_top
            __snake_case      :    List[Any]  			=end_n_top
            __snake_case      :    Any  			=mask_token_id
            __snake_case      :    Optional[Any]  			=lang_id

            if "n_words" in kwargs:
                  __snake_case      :    Dict  			=kwargs['''n_words''']

            super().__init__(pad_token_id=a							,   bos_token_id=a							,   **a						)



class      _lowercase (     __A						):


      @property
      def _UpperCamelCase						(    self				:	Optional[Any]						):





            """simple docstring"""







            if self.task == "multiple-choice":
                  __snake_case      :    Union[str, Any]  			={0: '''batch''', 1: '''choice''', 2: '''sequence'''}
            else:
                  __snake_case      :    Optional[Any]  			={0: '''batch''', 1: '''sequence'''}
            return OrderedDict(
                [
                    ('''input_ids''', dynamic_axis),
                    ('''attention_mask''', dynamic_axis),
                    ('''token_type_ids''', dynamic_axis),
                ]						)










"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


UpperCamelCase_	:				str										= {"""processing_layoutxlm""": ["""LayoutXLMProcessor"""]}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Union[str, Any]										= ["""LayoutXLMTokenizer"""]

try:
    if not is_tokenizers_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    UpperCamelCase_	:				Optional[int]										= ["""LayoutXLMTokenizerFast"""]

if TYPE_CHECKING:
    from .processing_layoutxlm import LayoutXLMProcessor

    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_layoutxlm import LayoutXLMTokenizer

    try:
        if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_layoutxlm_fast import LayoutXLMTokenizerFast

else:
    import sys

    UpperCamelCase_	:				List[Any]										= _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)


