





from typing import Callable, Optional, Union

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


_UpperCamelCase    =	logging.get_logger(__name__)

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




class 			_lowerCamelCase	(      a      ):



      """simple docstring"""






      UpperCAmelCase_  : Tuple				      ="prophetnet"
      UpperCAmelCase_  : List[Any]				      =["past_key_values"]
      UpperCAmelCase_  : Dict				      ={
          "num_attention_heads": "num_encoder_attention_heads",
      }







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






        '''simple docstring'''






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

        # parameters for prophetnet
        __snake_case				:			Optional[Any]            =    ngram
        __snake_case				:			Dict            =    num_buckets
        __snake_case				:			Any            =    relative_max_distance
        __snake_case				:			str            =    disable_ngram_loss
        __snake_case				:			List[str]            =    eps

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

        __snake_case				:			Dict            =    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   UpperCAmelCase						(	self				)    ->				int:






        '''simple docstring'''






        return self.num_encoder_layers + self.num_decoder_layers







      @num_hidden_layers.setter
      def   UpperCAmelCase						(	self			,  UpperCAmelCase				)    ->				Optional[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`."				)








import warnings

from ...utils import logging
from .image_processing_maskformer import MaskFormerImageProcessor


_UpperCamelCase    =	logging.get_logger(__name__)




class 			_lowerCamelCase	(      a      ):



      """simple docstring"""






      def __init__(	self			,  *UpperCAmelCase			,  **UpperCAmelCase				)    ->				None:






        '''simple docstring'''






        warnings.warn(
            "The class MaskFormerFeatureExtractor is deprecated and will be removed in version 5 of Transformers."
            " Please use MaskFormerImageProcessor instead."			,  UpperCAmelCase			,  )
        super().__init__(*UpperCAmelCase			,  **UpperCAmelCase				)

