




from typing import TYPE_CHECKING

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


lowerCamelCase__ :   str					=							{
    'configuration_perceiver': ['PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'PerceiverConfig', 'PerceiverOnnxConfig'],
    'tokenization_perceiver': ['PerceiverTokenizer'],
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__ :   str					=							['PerceiverFeatureExtractor']
   lowerCamelCase__ :   Optional[int]					=							['PerceiverImageProcessor']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowerCamelCase__ :   List[str]					=							[
       'PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'PerceiverForImageClassificationConvProcessing',
       'PerceiverForImageClassificationFourier',
       'PerceiverForImageClassificationLearned',
       'PerceiverForMaskedLM',
       'PerceiverForMultimodalAutoencoding',
       'PerceiverForOpticalFlow',
       'PerceiverForSequenceClassification',
       'PerceiverLayer',
       'PerceiverModel',
       'PerceiverPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig
   from .tokenization_perceiver import PerceiverTokenizer

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_perceiver import PerceiverFeatureExtractor
      from .image_processing_perceiver import PerceiverImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_perceiver import (
          PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
          PerceiverForImageClassificationConvProcessing,
          PerceiverForImageClassificationFourier,
          PerceiverForImageClassificationLearned,
          PerceiverForMaskedLM,
          PerceiverForMultimodalAutoencoding,
          PerceiverForOpticalFlow,
          PerceiverForSequenceClassification,
          PerceiverLayer,
          PerceiverModel,
          PerceiverPreTrainedModel,
      )

else:
   import sys

   lowerCamelCase__ :   Dict					=							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

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


__lowerCamelCase							=       logging.get_logger(__name__)

__lowerCamelCase							=       {
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}






class   UpperCAmelCase		(						A_ ):
   A__					:		List[str]						     =     "megatron-bert"



   def __init__(self		:					Optional[int]    ,						snake_case__		:					List[str]=2_90_56    ,						snake_case__		:					List[Any]=10_24    ,						snake_case__		:					str=24    ,						snake_case__		:					Tuple=16    ,						snake_case__		:					Union[str, Any]=40_96    ,						snake_case__		:					str="gelu"    ,						snake_case__		:					str=0.1    ,						snake_case__		:					Optional[int]=0.1    ,						snake_case__		:					Tuple=5_12    ,						snake_case__		:					Union[str, Any]=2    ,						snake_case__		:					Dict=0.02    ,						snake_case__		:					List[Any]=1e-12    ,						snake_case__		:					int=0    ,						snake_case__		:					Tuple="absolute"    ,						snake_case__		:					Any=True    ,						**snake_case__		:					Union[str, Any]    ,						)		->	Optional[Any]:


          '''simple docstring'''


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

          snake_case       :   Tuple							=      vocab_size
          snake_case       :   str							=      hidden_size
          snake_case       :   str							=      num_hidden_layers
          snake_case       :   str							=      num_attention_heads
          snake_case       :   Optional[int]							=      hidden_act
          snake_case       :   int							=      intermediate_size
          snake_case       :   List[str]							=      hidden_dropout_prob
          snake_case       :   Union[str, Any]							=      attention_probs_dropout_prob
          snake_case       :   Dict							=      max_position_embeddings
          snake_case       :   List[str]							=      type_vocab_size
          snake_case       :   List[str]							=      initializer_range
          snake_case       :   Tuple							=      layer_norm_eps
          snake_case       :   int							=      position_embedding_type
          snake_case       :   str							=      use_cache





