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


_UpperCAmelCase            =		logging.get_logger(__name__)

_UpperCAmelCase            =		{
    """funnel-transformer/small""": """https://huggingface.co/funnel-transformer/small/resolve/main/config.json""",
    """funnel-transformer/small-base""": """https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json""",
    """funnel-transformer/medium""": """https://huggingface.co/funnel-transformer/medium/resolve/main/config.json""",
    """funnel-transformer/medium-base""": """https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json""",
    """funnel-transformer/intermediate""": (
        """https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json"""
    ),
    """funnel-transformer/intermediate-base""": (
        """https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json"""
    ),
    """funnel-transformer/large""": """https://huggingface.co/funnel-transformer/large/resolve/main/config.json""",
    """funnel-transformer/large-base""": """https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json""",
    """funnel-transformer/xlarge""": """https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json""",
    """funnel-transformer/xlarge-base""": """https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json""",
}





class UpperCAmelCase						( __A  ):


				'''simple docstring'''






				lowerCamelCase_    = '''funnel'''
				lowerCamelCase_    = {
				    '''hidden_size''': '''d_model''',
				    '''num_attention_heads''': '''n_head''',
				}
				def __init__(						self		,     lowercase=3_0_5_2_2		,     lowercase=[4, 4, 4]		,     lowercase=None		,     lowercase=2		,     lowercase=7_6_8		,     lowercase=1_2		,     lowercase=6_4		,     lowercase=3_0_7_2		,     lowercase="gelu_new"		,     lowercase=0.1		,     lowercase=0.1		,     lowercase=0.0		,     lowercase=0.1		,     lowercase=None		,     lowercase=1E-9		,     lowercase="mean"		,     lowercase="relative_shift"		,     lowercase=True		,     lowercase=True		,     lowercase=True		,     **lowercase		,     ):



						"""simple docstring"""





						A_		:    Dict         =				vocab_size
						A_		:    Union[str, Any]         =				block_sizes
						A_		:    Union[str, Any]         =				[1] * len(lowercase ) if block_repeats is None else block_repeats
						assert len(lowercase ) == len(
						    self.block_repeats ), "`block_sizes` and `block_repeats` should have the same length."
						A_		:    Optional[Any]         =				num_decoder_layers
						A_		:    Optional[int]         =				d_model
						A_		:    Union[str, Any]         =				n_head
						A_		:    Tuple         =				d_head
						A_		:    Optional[Any]         =				d_inner
						A_		:    List[Any]         =				hidden_act
						A_		:    List[str]         =				hidden_dropout
						A_		:    Optional[Any]         =				attention_dropout
						A_		:    str         =				activation_dropout
						A_		:    Union[str, Any]         =				initializer_range
						A_		:    Optional[int]         =				initializer_std
						A_		:    Dict         =				layer_norm_eps
						assert pooling_type in [
						    "mean",
						    "max",
						], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
						A_		:    List[Any]         =				pooling_type
						assert attention_type in [
						    "relative_shift",
						    "factorized",
						], F'''Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'''
						A_		:    str         =				attention_type
						A_		:    Optional[int]         =				separate_cls
						A_		:    List[Any]         =				truncate_seq
						A_		:    Dict         =				pool_q_only

						super().__init__(**lowercase )
				@property
				def   lowerCAmelCase_       (						self ):



						"""simple docstring"""





						return sum(self.block_sizes )
				@num_hidden_layers.setter
				def   lowerCAmelCase_       (						self		,     lowercase ):



						"""simple docstring"""





						raise NotImplementedError(
						    'This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.' )
				@property
				def   lowerCAmelCase_       (						self ):



						"""simple docstring"""





						return len(self.block_sizes )







				@num_blocks.setter
				def   lowerCAmelCase_       (						self		,     lowercase ):



						"""simple docstring"""





						raise NotImplementedError('This model does not support the setting of `num_blocks`. Please set `block_sizes`.' )







import warnings

from ...utils import logging
from .image_processing_donut import DonutImageProcessor


_UpperCAmelCase            =		logging.get_logger(__name__)





class UpperCAmelCase						( __A  ):


				'''simple docstring'''






				def __init__(						self		,     *lowercase		,     **lowercase ):



						"""simple docstring"""





						warnings.warn(
						    'The class DonutFeatureExtractor is deprecated and will be removed in version 5 of Transformers. Please'
						    ' use DonutImageProcessor instead.'		,     lowercase		,     )
						super().__init__(*lowercase		,     **lowercase )






