




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


_lowerCamelCase     :		Any								=       logging.get_logger(__name__)

_lowerCamelCase     :		List[Any]								=       {
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}


class     UpperCamelCase_   (			UpperCAmelCase__					):

    '''simple docstring'''






    UpperCAmelCase__							  =				'''megatron-bert'''


    def __init__(      self				:     int ,			UpperCAmelCase__				:     Any=29_056 ,			UpperCAmelCase__				:     int=1_024 ,			UpperCAmelCase__				:     int=24 ,			UpperCAmelCase__				:     Optional[Any]=16 ,			UpperCAmelCase__				:     Union[str, Any]=4_096 ,			UpperCAmelCase__				:     List[str]="gelu" ,			UpperCAmelCase__				:     Any=0.1 ,			UpperCAmelCase__				:     str=0.1 ,			UpperCAmelCase__				:     List[Any]=512 ,			UpperCAmelCase__				:     Dict=2 ,			UpperCAmelCase__				:     Optional[int]=0.02 ,			UpperCAmelCase__				:     Union[str, Any]=1e-12 ,			UpperCAmelCase__				:     Union[str, Any]=0 ,			UpperCAmelCase__				:     Any="absolute" ,			UpperCAmelCase__				:     Optional[Any]=True ,			**UpperCAmelCase__				:     Union[str, Any] ,			)						->List[str]:





           '''simple docstring'''

           super().__init__(pad_token_id=UpperCAmelCase__ ,			**UpperCAmelCase__)

           A__							=   vocab_size
           A__							=   hidden_size
           A__							=   num_hidden_layers
           A__							=   num_attention_heads
           A__							=   hidden_act
           A__							=   intermediate_size
           A__							=   hidden_dropout_prob
           A__							=   attention_probs_dropout_prob
           A__							=   max_position_embeddings
           A__							=   type_vocab_size
           A__							=   initializer_range
           A__							=   layer_norm_eps
           A__							=   position_embedding_type
           A__							=   use_cache








from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_speech_available,
    is_torch_available,
)


_lowerCamelCase     :		Optional[Any]								=       {
    """configuration_trocr""": ["""TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP""", """TrOCRConfig"""],
    """processing_trocr""": ["""TrOCRProcessor"""],
}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCamelCase     :		Any								=       [
      """TROCR_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """TrOCRForCausalLM""",
      """TrOCRPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig
  from .processing_trocr import TrOCRProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel

else:
  import sys

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


