'''simple docstring'''




from ...configuration_utils import PretrainedConfig
from ...utils import logging


__UpperCAmelCase					=logging.get_logger(__name__)

__UpperCAmelCase					={
    "microsoft/trocr-base-handwritten": (
        "https://huggingface.co/microsoft/trocr-base-handwritten/resolve/main/config.json"
    ),
    # See all TrOCR models at https://huggingface.co/models?filter=trocr
}




class        a__ (  UpperCAmelCase__					):
     lowerCamelCase    :	Dict				="trocr"
     lowerCamelCase    :	int				=["past_key_values"]
     lowerCamelCase    :	Optional[int]				={
         "num_attention_heads": "decoder_attention_heads",
         "hidden_size": "d_model",
         "num_hidden_layers": "decoder_layers",
     }






     def __init__(					self						:						List[Any]    ,							a						:						Tuple=5_02_65    ,							a						:						Optional[Any]=10_24    ,							a						:						Dict=12    ,							a						:						Tuple=16    ,							a						:						Any=40_96    ,							a						:						List[str]="gelu"    ,							a						:						Union[str, Any]=5_12    ,							a						:						Dict=0.1    ,							a						:						List[Any]=0.0    ,							a						:						Optional[int]=0.0    ,							a						:						Dict=2    ,							a						:						Union[str, Any]=0.02    ,							a						:						Tuple=0.0    ,							a						:						Optional[Any]=True    ,							a						:						int=False    ,							a						:						Tuple=True    ,							a						:						str=True    ,							a						:						Optional[Any]=1    ,							a						:						int=0    ,							a						:						Optional[Any]=2    ,							**a						:						List[Any]    ,							):





         """simple docstring"""



         __lowerCamelCase            =    vocab_size
         __lowerCamelCase            =    d_model
         __lowerCamelCase            =    decoder_layers
         __lowerCamelCase            =    decoder_attention_heads
         __lowerCamelCase            =    decoder_ffn_dim
         __lowerCamelCase            =    activation_function
         __lowerCamelCase            =    max_position_embeddings
         __lowerCamelCase            =    dropout
         __lowerCamelCase            =    attention_dropout
         __lowerCamelCase            =    activation_dropout
         __lowerCamelCase            =    init_std
         __lowerCamelCase            =    decoder_layerdrop
         __lowerCamelCase            =    use_cache
         __lowerCamelCase            =    scale_embedding
         __lowerCamelCase            =    use_learned_position_embeddings
         __lowerCamelCase            =    layernorm_embedding

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

'''simple docstring'''




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__UpperCAmelCase					={
    "configuration_mobilebert": [
        "MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "MobileBertConfig",
        "MobileBertOnnxConfig",
    ],
    "tokenization_mobilebert": ["MobileBertTokenizer"],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase					=["MobileBertTokenizerFast"]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase					=[
      "MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
      "MobileBertForMaskedLM",
      "MobileBertForMultipleChoice",
      "MobileBertForNextSentencePrediction",
      "MobileBertForPreTraining",
      "MobileBertForQuestionAnswering",
      "MobileBertForSequenceClassification",
      "MobileBertForTokenClassification",
      "MobileBertLayer",
      "MobileBertModel",
      "MobileBertPreTrainedModel",
      "load_tf_weights_in_mobilebert",
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase					=[
      "TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TFMobileBertForMaskedLM",
      "TFMobileBertForMultipleChoice",
      "TFMobileBertForNextSentencePrediction",
      "TFMobileBertForPreTraining",
      "TFMobileBertForQuestionAnswering",
      "TFMobileBertForSequenceClassification",
      "TFMobileBertForTokenClassification",
      "TFMobileBertMainLayer",
      "TFMobileBertModel",
      "TFMobileBertPreTrainedModel",
  ]


if TYPE_CHECKING:
  from .configuration_mobilebert import (
      MOBILEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
      MobileBertConfig,
      MobileBertOnnxConfig,
  )
  from .tokenization_mobilebert import MobileBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_mobilebert_fast import MobileBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_mobilebert import (
        MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        MobileBertForMaskedLM,
        MobileBertForMultipleChoice,
        MobileBertForNextSentencePrediction,
        MobileBertForPreTraining,
        MobileBertForQuestionAnswering,
        MobileBertForSequenceClassification,
        MobileBertForTokenClassification,
        MobileBertLayer,
        MobileBertModel,
        MobileBertPreTrainedModel,
        load_tf_weights_in_mobilebert,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_mobilebert import (
        TF_MOBILEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFMobileBertForMaskedLM,
        TFMobileBertForMultipleChoice,
        TFMobileBertForNextSentencePrediction,
        TFMobileBertForPreTraining,
        TFMobileBertForQuestionAnswering,
        TFMobileBertForSequenceClassification,
        TFMobileBertForTokenClassification,
        TFMobileBertMainLayer,
        TFMobileBertModel,
        TFMobileBertPreTrainedModel,
    )

else:
  import sys

  __UpperCAmelCase					=_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
