'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


UpperCamelCase       :     Tuple			=    {
    """configuration_markuplm""": ["""MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """MarkupLMConfig"""],
    """feature_extraction_markuplm""": ["""MarkupLMFeatureExtractor"""],
    """processing_markuplm""": ["""MarkupLMProcessor"""],
    """tokenization_markuplm""": ["""MarkupLMTokenizer"""],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase       :     int			=    ["""MarkupLMTokenizerFast"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase       :     Any			=    [
          """MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """MarkupLMForQuestionAnswering""",
          """MarkupLMForSequenceClassification""",
          """MarkupLMForTokenClassification""",
          """MarkupLMModel""",
          """MarkupLMPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
      from .feature_extraction_markuplm import MarkupLMFeatureExtractor
      from .processing_markuplm import MarkupLMProcessor
      from .tokenization_markuplm import MarkupLMTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_markuplm_fast import MarkupLMTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_markuplm import (
                MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
                MarkupLMForQuestionAnswering,
                MarkupLMForSequenceClassification,
                MarkupLMForTokenClassification,
                MarkupLMModel,
                MarkupLMPreTrainedModel,
            )


else:
      import sys

      UpperCamelCase       :     Dict			=    _LazyModule(__name__, globals()["""__file__"""], _import_structure)


'''simple docstring'''





from collections import OrderedDict
from typing import Mapping

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


UpperCamelCase       :     Dict			=    logging.get_logger(__name__)

UpperCamelCase       :     Tuple			=    {
    """flaubert/flaubert_small_cased""": """https://huggingface.co/flaubert/flaubert_small_cased/resolve/main/config.json""",
    """flaubert/flaubert_base_uncased""": """https://huggingface.co/flaubert/flaubert_base_uncased/resolve/main/config.json""",
    """flaubert/flaubert_base_cased""": """https://huggingface.co/flaubert/flaubert_base_cased/resolve/main/config.json""",
    """flaubert/flaubert_large_cased""": """https://huggingface.co/flaubert/flaubert_large_cased/resolve/main/config.json""",
}



class   UpperCamelCase					(       a_       ):







    """simple docstring"""





    A     :    int				=			"flaubert"
    A     :    List[str]				=			{
        "hidden_size": "emb_dim",
        "num_attention_heads": "n_heads",
        "num_hidden_layers": "n_layers",
        "n_words": "vocab_size",  # For backward compatibility
    }





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


         """simple docstring"""







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

         if "n_words" in kwargs:
              a					:							int							= kwargs['n_words']

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






class   UpperCamelCase					(       a_       ):







    """simple docstring"""





    @property
    def    SCREAMING_SNAKE_CASE_     (					self     :						str):


         """simple docstring"""







         if self.task == "multiple-choice":
              a					:							int							= {0: 'batch', 1: 'choice', 2: 'sequence'}
         else:
              a					:							Tuple							= {0: 'batch', 1: 'sequence'}
         return OrderedDict(
             [
                 ('input_ids', dynamic_axis),
                 ('attention_mask', dynamic_axis),
             ])

