
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__magic_name__  							=	{'''configuration_vit_msn''': ['''VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''ViTMSNConfig''']}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     __magic_name__  							=	[
         '''VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''ViTMSNModel''',
         '''ViTMSNForImageClassification''',
         '''ViTMSNPreTrainedModel''',
     ]

if TYPE_CHECKING:
     from .configuration_vit_msn import VIT_MSN_PRETRAINED_CONFIG_ARCHIVE_MAP, ViTMSNConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_vit_msn import (
              VIT_MSN_PRETRAINED_MODEL_ARCHIVE_LIST,
              ViTMSNForImageClassification,
              ViTMSNModel,
              ViTMSNPreTrainedModel,
          )

else:
     import sys

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








"""simple docstring"""







from typing import Callable, Optional, Union

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


a_							=    logging.get_logger(__name__)

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







class 					A_(SCREAMING_SNAKE_CASE_      ):







			"""simple docstring"""



			a_       :			List[Any]												=			"""xlm-prophetnet"""
			a_       :			Any												=			["""past_key_values"""]
			a_       :			Optional[int]												=			{
			    """num_attention_heads""": """num_encoder_attention_heads""",
			}
			def __init__(	self				,   A = 0.1				,   A = "gelu"				,   A = 3_0522				,   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				,   ):
						_lowerCamelCase					:					Dict	       =    vocab_size
						_lowerCamelCase					:					List[Any]	       =    hidden_size
						_lowerCamelCase					:					List[Any]	       =    encoder_ffn_dim
						_lowerCamelCase					:					Any	       =    num_encoder_layers
						_lowerCamelCase					:					Any	       =    num_encoder_attention_heads
						_lowerCamelCase					:					List[str]	       =    decoder_ffn_dim
						_lowerCamelCase					:					Optional[int]	       =    num_decoder_layers
						_lowerCamelCase					:					List[str]	       =    num_decoder_attention_heads
						_lowerCamelCase					:					Optional[Any]	       =    max_position_embeddings
						_lowerCamelCase					:					Optional[Any]	       =    init_std  # Normal(0, this parameter)
						_lowerCamelCase					:					Optional[int]	       =    activation_function

						# parameters for xlmprophetnet
						_lowerCamelCase					:					Any	       =    ngram
						_lowerCamelCase					:					Dict	       =    num_buckets
						_lowerCamelCase					:					Dict	       =    relative_max_distance
						_lowerCamelCase					:					Optional[Any]	       =    disable_ngram_loss
						_lowerCamelCase					:					Union[str, Any]	       =    eps

						# 3 Types of Dropout
						_lowerCamelCase					:					int	       =    attention_dropout
						_lowerCamelCase					:					str	       =    activation_dropout
						_lowerCamelCase					:					Optional[int]	       =    dropout

						_lowerCamelCase					:					List[Any]	       =    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							):
						return self.num_encoder_layers + self.num_decoder_layers

			@num_hidden_layers.setter
			def    _lowerCAmelCase		(	self				,   A							):
						raise NotImplementedError(
						    'This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and'
						    ' `num_decoder_layers`.'							)





