






"""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   :   Tuple    		=		{
    """microsoft/prophetnet-large-uncased""": (
        """https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json"""
    ),
}



class 					UpperCamelCase__   (							a_):







    """simple docstring"""
    __UpperCAmelCase											=   """prophetnet"""
    __UpperCAmelCase											=   ["""past_key_values"""]
    __UpperCAmelCase											=   {
        """num_attention_heads""": """num_encoder_attention_heads""",
    }







    def __init__(		self   :  Any							,						UpperCamelCase_   :  Optional[float] = 0.1							,						UpperCamelCase_   :  Optional[Union[str, Callable]] = "gelu"							,						UpperCamelCase_   :  Optional[int] = 3_0_5_2_2							,						UpperCamelCase_   :  Optional[int] = 1_0_2_4							,						UpperCamelCase_   :  Optional[int] = 4_0_9_6							,						UpperCamelCase_   :  Optional[int] = 1_2							,						UpperCamelCase_   :  Optional[int] = 1_6							,						UpperCamelCase_   :  Optional[int] = 4_0_9_6							,						UpperCamelCase_   :  Optional[int] = 1_2							,						UpperCamelCase_   :  Optional[int] = 1_6							,						UpperCamelCase_   :  Optional[float] = 0.1							,						UpperCamelCase_   :  Optional[float] = 0.1							,						UpperCamelCase_   :  Optional[int] = 5_1_2							,						UpperCamelCase_   :  Optional[float] = 0.02							,						UpperCamelCase_   :  Optional[bool] = True							,						UpperCamelCase_   :  Optional[bool] = True							,						UpperCamelCase_   :  Optional[int] = 0							,						UpperCamelCase_   :  Optional[int] = 2							,						UpperCamelCase_   :  Optional[int] = 3_2							,						UpperCamelCase_   :  Optional[int] = 1_2_8							,						UpperCamelCase_   :  Optional[bool] = False							,						UpperCamelCase_   :  Optional[float] = 0.0							,						UpperCamelCase_   :  Optional[bool] = True							,						UpperCamelCase_   :  Optional[int] = 0							,						UpperCamelCase_   :  Optional[int] = 1							,						UpperCamelCase_   :  Optional[int] = 2							,						**UpperCamelCase_   :  Dict							,						):





           '''simple docstring'''

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

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

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

           __magic_name__										=						use_cache

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







    @property
    def 							a__ (		self   :  Optional[int]   ):





           '''simple docstring'''

           return self.num_encoder_layers + self.num_decoder_layers







    @num_hidden_layers.setter
    def 							a__ (		self   :  List[Any]							,						UpperCamelCase_   :  int   ):





           '''simple docstring'''

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







"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


snake_case   :   Optional[int]    		=		{
    """configuration_splinter""": ["""SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SplinterConfig"""],
    """tokenization_splinter""": ["""SplinterTokenizer"""],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case   :   Dict    		=		["""SplinterTokenizerFast"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case   :   Dict    		=		[
     """SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """SplinterForQuestionAnswering""",
     """SplinterForPreTraining""",
     """SplinterLayer""",
     """SplinterModel""",
     """SplinterPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_splinter import SPLINTER_PRETRAINED_CONFIG_ARCHIVE_MAP, SplinterConfig
 from .tokenization_splinter import SplinterTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_splinter_fast import SplinterTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_splinter import (
      SPLINTER_PRETRAINED_MODEL_ARCHIVE_LIST,
      SplinterForPreTraining,
      SplinterForQuestionAnswering,
      SplinterLayer,
      SplinterModel,
      SplinterPreTrainedModel,
  )


else:
 import sys

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