'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

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


lowerCAmelCase_			:			Any    	=   logging.get_logger(__name__)

lowerCAmelCase_			:			str    	=   {
    "mnaylor/mega-base-wikitext": "https://huggingface.co/mnaylor/mega-base-wikitext/resolve/main/config.json",
}





class 				lowercase    (    snake_case__			):
   lowerCamelCase_            ='mega'


   def __init__( self					:						Optional[Any] ,		__lowerCAmelCase					:						List[str]=3_0522 ,		__lowerCAmelCase					:						Optional[int]=128 ,		__lowerCAmelCase					:						Optional[int]=4 ,		__lowerCAmelCase					:						Tuple=256 ,		__lowerCAmelCase					:						Any=16 ,		__lowerCAmelCase					:						List[Any]=True ,		__lowerCAmelCase					:						int=64 ,		__lowerCAmelCase					:						List[str]=False ,		__lowerCAmelCase					:						Tuple=-1 ,		__lowerCAmelCase					:						List[str]=None ,		__lowerCAmelCase					:						Optional[Any]=True ,		__lowerCAmelCase					:						Tuple="scalenorm" ,		__lowerCAmelCase					:						List[Any]=True ,		__lowerCAmelCase					:						Optional[Any]="silu" ,		__lowerCAmelCase					:						int="softmax" ,		__lowerCAmelCase					:						List[Any]=0.1 ,		__lowerCAmelCase					:						str=0.1 ,		__lowerCAmelCase					:						Dict=0.1 ,		__lowerCAmelCase					:						Dict=False ,		__lowerCAmelCase					:						Optional[Any]=True ,		__lowerCAmelCase					:						Union[str, Any]=256 ,		__lowerCAmelCase					:						int=True ,		__lowerCAmelCase					:						Optional[Any]=0.1 ,		__lowerCAmelCase					:						Dict=2048 ,		__lowerCAmelCase					:						Optional[Any]=False ,		__lowerCAmelCase					:						Any=2 ,		__lowerCAmelCase					:						Dict=0.02 ,		__lowerCAmelCase					:						Optional[Any]=0.2 ,		__lowerCAmelCase					:						Tuple=0.02 ,		__lowerCAmelCase					:						List[Any]=1.0 ,		__lowerCAmelCase					:						Any=1 ,		__lowerCAmelCase					:						Union[str, Any]=0 ,		__lowerCAmelCase					:						Any=2 ,		__lowerCAmelCase					:						Tuple="rotary" ,		__lowerCAmelCase					:						Any=None ,		__lowerCAmelCase					:						Any=True ,		__lowerCAmelCase					:						Tuple=True ,		**__lowerCAmelCase					:						List[Any] ,		)   ->       Optional[int]:
         super().__init__(pad_token_id=lowercase_ ,		bos_token_id=lowercase_ ,		eos_token_id=lowercase_ ,		**lowercase_)

         lowercase_     			=   vocab_size
         lowercase_     			=   hidden_size
         lowercase_     			=   num_hidden_layers
         lowercase_     			=   activation
         lowercase_     			=   attention_activation
         lowercase_     			=   intermediate_size
         lowercase_     			=   ema_projection_size
         lowercase_     			=   bidirectional
         lowercase_     			=   shared_representation_size
         lowercase_     			=   use_chunking
         lowercase_     			=   chunk_size
         lowercase_     			=   truncation
         lowercase_     			=   normalize_before_mega
         lowercase_     			=   normalization_type
         lowercase_     			=   norm_affine
         lowercase_     			=   dropout_prob
         lowercase_     			=   hidden_dropout_prob
         lowercase_     			=   attention_probs_dropout_prob
         lowercase_     			=   use_feature_dropout
         lowercase_     			=   use_normalized_ffn
         lowercase_     			=   nffn_hidden_size
         lowercase_     			=   normalize_before_ffn
         lowercase_     			=   nffn_activation_dropout_prob
         lowercase_     			=   max_positions
         lowercase_     			=   add_token_type_embeddings
         lowercase_     			=   type_vocab_size
         lowercase_     			=   initializer_range
         lowercase_     			=   ema_delta_alpha_range
         lowercase_     			=   ema_beta_range
         lowercase_     			=   ema_gamma_omega_range
         lowercase_     			=   relative_positional_bias
         lowercase_     			=   use_cache
         lowercase_     			=   classifier_dropout
         lowercase_     			=   add_lm_hidden_dense_layer
         lowercase_     			=   1  # not used but required by Hugging Face





class 				lowercase    (    snake_case__			):


   @property
   def __UpperCAmelCase							( self					:						List[Any])   ->       Dict:
         if self.task == "multiple-choice":
               lowercase_     			=   {0: "batch", 1: "choice", 2: "sequence"}
         else:
               lowercase_     			=   {0: "batch", 1: "sequence"}
         return OrderedDict(
             [
                 ("input_ids", dynamic_axis),
                 ("attention_mask", dynamic_axis),
             ])








'''simple docstring'''
from typing import TYPE_CHECKING

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


a_           =    {
    "configuration_sam": [
        "SAM_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "SamConfig",
        "SamMaskDecoderConfig",
        "SamPromptEncoderConfig",
        "SamVisionConfig",
    ],
    "processing_sam": ["SamProcessor"],
}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    [
      "SAM_PRETRAINED_MODEL_ARCHIVE_LIST",
      "SamModel",
      "SamPreTrainedModel",
  ]
try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    [
      "TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST",
      "TFSamModel",
      "TFSamPreTrainedModel",
  ]
try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  a_           =    ["SamImageProcessor"]


if TYPE_CHECKING:
  from .configuration_sam import (
      SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
      SamConfig,
      SamMaskDecoderConfig,
      SamPromptEncoderConfig,
      SamVisionConfig,
  )
  from .processing_sam import SamProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .image_processing_sam import SamImageProcessor

else:
  import sys

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




