






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


__lowerCamelCase      :    Dict   		=   logging.get_logger(__name__)

__lowerCamelCase      :    Dict   		=   {
    """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 							SCREAMING_SNAKE_CASE__		(       UpperCamelCase_		):





					"""simple docstring"""






					a_			=	"funnel"
					a_			=	{
					    "hidden_size": "d_model",
					    "num_attention_heads": "n_head",
					}



					def __init__(      self  :						List[Any]							,	__A  :						Optional[Any]=3_0_5_2_2							,	__A  :						str=[4, 4, 4]							,	__A  :						Optional[Any]=None							,	__A  :						Optional[Any]=2							,	__A  :						Tuple=7_6_8							,	__A  :						int=1_2							,	__A  :						Union[str, Any]=6_4							,	__A  :						List[str]=3_0_7_2							,	__A  :						List[str]="gelu_new"							,	__A  :						Optional[int]=0.1							,	__A  :						Optional[Any]=0.1							,	__A  :						Union[str, Any]=0.0							,	__A  :						Optional[int]=0.1							,	__A  :						Tuple=None							,	__A  :						List[Any]=1e-9							,	__A  :						Dict="mean"							,	__A  :						Union[str, Any]="relative_shift"							,	__A  :						Union[str, Any]=True							,	__A  :						Union[str, Any]=True							,	__A  :						Any=True							,	**__A  :						Optional[Any]							,	):
						snake_case__				:   Optional[int]     =						vocab_size
						snake_case__				:   Any     =						block_sizes
						snake_case__				:   List[Any]     =						[1] * len(__A ) if block_repeats is None else block_repeats
						assert len(__A ) == len(
						    self.block_repeats ), "`block_sizes` and `block_repeats` should have the same length."
						snake_case__				:   Dict     =						num_decoder_layers
						snake_case__				:   List[Any]     =						d_model
						snake_case__				:   Union[str, Any]     =						n_head
						snake_case__				:   List[Any]     =						d_head
						snake_case__				:   int     =						d_inner
						snake_case__				:   Union[str, Any]     =						hidden_act
						snake_case__				:   Any     =						hidden_dropout
						snake_case__				:   str     =						attention_dropout
						snake_case__				:   Dict     =						activation_dropout
						snake_case__				:   Dict     =						initializer_range
						snake_case__				:   Optional[Any]     =						initializer_std
						snake_case__				:   List[str]     =						layer_norm_eps
						assert pooling_type in [
						    "mean",
						    "max",
						], f'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
						snake_case__				:   Optional[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.'''
						snake_case__				:   int     =						attention_type
						snake_case__				:   int     =						separate_cls
						snake_case__				:   Union[str, Any]     =						truncate_seq
						snake_case__				:   Optional[int]     =						pool_q_only

						super().__init__(**__A )



					@property
					def  _lowercase  (      self  :						List[Any] ):
						return sum(self.block_sizes )



					@num_hidden_layers.setter
					def  _lowercase  (      self  :						int							,	__A  :						int ):
						raise NotImplementedError(
						    "This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`." )



					@property
					def  _lowercase  (      self  :						Optional[Any] ):
						return len(self.block_sizes )






					@num_blocks.setter
					def  _lowercase  (      self  :						Optional[int]							,	__A  :						List[str] ):
						raise NotImplementedError("This model does not support the setting of `num_blocks`. Please set `block_sizes`." )











# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run

import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
__lowerCamelCase      :    Dict   		=   abspath(join(dirname(dirname(__file__)), """src"""))
sys.path.insert(1, git_repo_path)

# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action="""ignore""", category=FutureWarning)







def   SCREAMING_SNAKE_CASE       (				snake_case_      :							str     ):
	from diffusers.utils.testing_utils import pytest_addoption_shared

	pytest_addoption_shared(snake_case_     )







def   SCREAMING_SNAKE_CASE       (				snake_case_      :							Any     ):
	from diffusers.utils.testing_utils import pytest_terminal_summary_main

	snake_case__				:   Optional[int]     =						terminalreporter.config.getoption("--make-reports"     )
	if make_reports:
		pytest_terminal_summary_main(snake_case_  ,						id=snake_case_     )



