





'''simple docstring'''







from typing import Callable, Optional, Union

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


snake_case_  :							str            =	logging.get_logger(__name__)

snake_case_  :							List[Any]            =	{
    "microsoft/prophetnet-large-uncased": (
        "https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json"
    ),
}


class        __a   (lowerCamelCase  ):
							__a       : List[str]          =							"prophetnet"
							__a       : Any          =							["past_key_values"]
							__a       : Dict          =							{
							    "num_attention_heads": "num_encoder_attention_heads",
							}

							def __init__(				self				:  List[str]							,  __magic_name__				:  Optional[float] = 0.1							,  __magic_name__				:  Optional[Union[str, Callable]] = "gelu"							,  __magic_name__				:  Optional[int] = 3_05_22							,  __magic_name__				:  Optional[int] = 10_24							,  __magic_name__				:  Optional[int] = 40_96							,  __magic_name__				:  Optional[int] = 12							,  __magic_name__				:  Optional[int] = 16							,  __magic_name__				:  Optional[int] = 40_96							,  __magic_name__				:  Optional[int] = 12							,  __magic_name__				:  Optional[int] = 16							,  __magic_name__				:  Optional[float] = 0.1							,  __magic_name__				:  Optional[float] = 0.1							,  __magic_name__				:  Optional[int] = 5_12							,  __magic_name__				:  Optional[float] = 0.0_2							,  __magic_name__				:  Optional[bool] = True							,  __magic_name__				:  Optional[bool] = True							,  __magic_name__				:  Optional[int] = 0							,  __magic_name__				:  Optional[int] = 2							,  __magic_name__				:  Optional[int] = 32							,  __magic_name__				:  Optional[int] = 1_28							,  __magic_name__				:  Optional[bool] = False							,  __magic_name__				:  Optional[float] = 0.0							,  __magic_name__				:  Optional[bool] = True							,  __magic_name__				:  Optional[int] = 0							,  __magic_name__				:  Optional[int] = 1							,  __magic_name__				:  Optional[int] = 2							,  **__magic_name__				:  Any							,  )       ->							List[Any]:







													"""simple docstring"""
													UpperCAmelCase_      :   List[str]      =	vocab_size
													UpperCAmelCase_      :   Optional[Any]      =	hidden_size
													UpperCAmelCase_      :   Any      =	encoder_ffn_dim
													UpperCAmelCase_      :   Dict      =	num_encoder_layers
													UpperCAmelCase_      :   int      =	num_encoder_attention_heads
													UpperCAmelCase_      :   Optional[int]      =	decoder_ffn_dim
													UpperCAmelCase_      :   Any      =	num_decoder_layers
													UpperCAmelCase_      :   Optional[Any]      =	num_decoder_attention_heads
													UpperCAmelCase_      :   Any      =	max_position_embeddings
													UpperCAmelCase_      :   Optional[Any]      =	init_std  # Normal(0, this parameter)
													UpperCAmelCase_      :   Union[str, Any]      =	activation_function

													# parameters for prophetnet
													UpperCAmelCase_      :   Optional[int]      =	ngram
													UpperCAmelCase_      :   Optional[Any]      =	num_buckets
													UpperCAmelCase_      :   List[Any]      =	relative_max_distance
													UpperCAmelCase_      :   Tuple      =	disable_ngram_loss
													UpperCAmelCase_      :   Any      =	eps

													# 3 Types of Dropout
													UpperCAmelCase_      :   Any      =	attention_dropout
													UpperCAmelCase_      :   int      =	activation_dropout
													UpperCAmelCase_      :   Union[str, Any]      =	dropout

													UpperCAmelCase_      :   int      =	use_cache

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

							@property
							def      UpperCAmelCase__						(				self				:  List[Any] )       ->							int:







													"""simple docstring"""
													return self.num_encoder_layers + self.num_decoder_layers



							@num_hidden_layers.setter
							def      UpperCAmelCase__						(				self				:  List[Any]							,  __magic_name__				:  Tuple )       ->							str:







													"""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


_A							=       {'''configuration_dinat''': ['''DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''DinatConfig''']}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _A							=       [
          '''DINAT_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''DinatForImageClassification''',
          '''DinatModel''',
          '''DinatPreTrainedModel''',
          '''DinatBackbone''',
      ]

if TYPE_CHECKING:
      from .configuration_dinat import DINAT_PRETRAINED_CONFIG_ARCHIVE_MAP, DinatConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_dinat import (
                DINAT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DinatBackbone,
                DinatForImageClassification,
                DinatModel,
                DinatPreTrainedModel,
            )

else:
      import sys

      _A							=       _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



