




from typing import Callable, Optional, Union

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


lowercase__   :    Tuple 					=      logging.get_logger(__name__)

lowercase__   :    int 					=      {
    "microsoft/prophetnet-large-uncased": (
        "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json"
    ),
}




class     a__ (      UpperCamelCase__   ):
     a	:    Any	      =			"""prophetnet"""
     a	:    Any	      =			["""past_key_values"""]
     a	:    str	      =			{
         """num_attention_heads""": """num_encoder_attention_heads""",
     }







     def __init__(			self						,	A = 0.1						,	A = "gelu"						,	A = 30522						,	A = 1024						,	A = 4096						,	A = 12						,	A = 16						,	A = 4096						,	A = 12						,	A = 16						,	A = 0.1						,	A = 0.1						,	A = 512						,	A = 0.0_2						,	A = True						,	A = True						,	A = 0						,	A = 2						,	A = 32						,	A = 128						,	A = False						,	A = 0.0						,	A = True						,	A = 0						,	A = 1						,	A = 2						,	**A						,	)						->					List[str]:



          '''simple docstring'''



          a											=   vocab_size
          a											=   hidden_size
          a											=   encoder_ffn_dim
          a											=   num_encoder_layers
          a											=   num_encoder_attention_heads
          a											=   decoder_ffn_dim
          a											=   num_decoder_layers
          a											=   num_decoder_attention_heads
          a											=   max_position_embeddings
          a											=   init_std  # Normal(0, this parameter)
          a											=   activation_function

          # parameters for prophetnet
          a											=   ngram
          a											=   num_buckets
          a											=   relative_max_distance
          a											=   disable_ngram_loss
          a											=   eps

          # 3 Types of Dropout
          a											=   attention_dropout
          a											=   activation_dropout
          a											=   dropout

          a											=   use_cache

          super().__init__(
              pad_token_id=A						,	bos_token_id=A						,	eos_token_id=A						,	is_encoder_decoder=A						,	add_cross_attention=A						,	decoder_start_token_id=A						,	**A						,	)







     @property
     def     lowerCAmelCase_       (			self				)						->					int:



          '''simple docstring'''



          return self.num_encoder_layers + self.num_decoder_layers







     @num_hidden_layers.setter
     def     lowerCAmelCase_       (			self						,	A				)						->					Tuple:



          '''simple docstring'''



          raise NotImplementedError(
              "This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"
              " `num_decoder_layers`."				)







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowercase__   :    Union[str, Any] 					=      {"configuration_visual_bert": ["VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "VisualBertConfig"]}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   lowercase__   :    List[Any] 					=      [
       "VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST",
       "VisualBertForMultipleChoice",
       "VisualBertForPreTraining",
       "VisualBertForQuestionAnswering",
       "VisualBertForRegionToPhraseAlignment",
       "VisualBertForVisualReasoning",
       "VisualBertLayer",
       "VisualBertModel",
       "VisualBertPreTrainedModel",
   ]


if TYPE_CHECKING:
   from .configuration_visual_bert import VISUAL_BERT_PRETRAINED_CONFIG_ARCHIVE_MAP, VisualBertConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_visual_bert import (
          VISUAL_BERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          VisualBertForMultipleChoice,
          VisualBertForPreTraining,
          VisualBertForQuestionAnswering,
          VisualBertForRegionToPhraseAlignment,
          VisualBertForVisualReasoning,
          VisualBertLayer,
          VisualBertModel,
          VisualBertPreTrainedModel,
      )


else:
   import sys

   lowercase__   :    Union[str, Any] 					=      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

