
"""simple docstring"""
from typing import Callable, Optional, Union

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


_a      :			Optional[Any]					=							logging.get_logger(__name__)

_a      :			Dict					=							{
    """microsoft/xprophetnet-large-wiki100-cased""": (
        """https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json"""
    ),
}






class      _UpperCAmelCase				(					_snake_case):
    __lowercase							: Optional[int]  =					"""xlm-prophetnet"""
    __lowercase							: Union[str, Any]  =					["""past_key_values"""]
    __lowercase							: str  =					{
        """num_attention_heads""": """num_encoder_attention_heads""",
    }
    def __init__(    self						,    snake_case_ = 0.1						,    snake_case_ = "gelu"						,    snake_case_ = 3_05_22						,    snake_case_ = 10_24						,    snake_case_ = 40_96						,    snake_case_ = 12						,    snake_case_ = 16						,    snake_case_ = 40_96						,    snake_case_ = 12						,    snake_case_ = 16						,    snake_case_ = 0.1						,    snake_case_ = 0.1						,    snake_case_ = 5_12						,    snake_case_ = 0.02						,    snake_case_ = True						,    snake_case_ = True						,    snake_case_ = 0						,    snake_case_ = 2						,    snake_case_ = 32						,    snake_case_ = 1_28						,    snake_case_ = False						,    snake_case_ = 0.0						,    snake_case_ = True						,    snake_case_ = 0						,    snake_case_ = 1						,    snake_case_ = 2						,    **snake_case_						,    ):
      _snake_case     :						Union[str, Any]						=   vocab_size
      _snake_case     :						Dict						=   hidden_size
      _snake_case     :						int						=   encoder_ffn_dim
      _snake_case     :						Union[str, Any]						=   num_encoder_layers
      _snake_case     :						Dict						=   num_encoder_attention_heads
      _snake_case     :						Tuple						=   decoder_ffn_dim
      _snake_case     :						Dict						=   num_decoder_layers
      _snake_case     :						Dict						=   num_decoder_attention_heads
      _snake_case     :						int						=   max_position_embeddings
      _snake_case     :						Dict						=   init_std  # Normal(0, this parameter)
      _snake_case     :						int						=   activation_function

      # parameters for xlmprophetnet
      _snake_case     :						Any						=   ngram
      _snake_case     :						Union[str, Any]						=   num_buckets
      _snake_case     :						str						=   relative_max_distance
      _snake_case     :						Any						=   disable_ngram_loss
      _snake_case     :						List[str]						=   eps

      # 3 Types of Dropout
      _snake_case     :						Optional[Any]						=   attention_dropout
      _snake_case     :						Tuple						=   activation_dropout
      _snake_case     :						Any						=   dropout

      _snake_case     :						List[str]						=   use_cache

      super().__init__(
          pad_token_id=lowercase_						,    bos_token_id=lowercase_						,    eos_token_id=lowercase_						,    is_encoder_decoder=lowercase_						,    add_cross_attention=lowercase_						,    decoder_start_token_id=lowercase_						,    **lowercase_						,    )
    @property
    def 					lowerCamelCase__	(    self     ):
      return self.num_encoder_layers + self.num_decoder_layers


    @num_hidden_layers.setter
    def 					lowerCamelCase__	(    self						,    snake_case_     ):
      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_sentencepiece_available


_a      :			List[Any]					=							{}

try:
    if not is_sentencepiece_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    _a      :			List[Any]					=							["""BartphoTokenizer"""]

if TYPE_CHECKING:
    try:
        if not is_sentencepiece_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .tokenization_bartpho import BartphoTokenizer

else:
    import sys

    _a      :			Optional[int]					=							_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

