



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


lowerCamelCase		       =      logging.get_logger(__name__)

lowerCamelCase		       =      {
    """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 				_a						(       SCREAMING_SNAKE_CASE			):





							'''simple docstring'''

							A				:Any =       "funnel"
							A				:Any =       {
							    "hidden_size": "d_model",
							    "num_attention_heads": "n_head",
							}



							def __init__(							self ,					__UpperCAmelCase=3_0522 ,					__UpperCAmelCase=[4, 4, 4] ,					__UpperCAmelCase=None ,					__UpperCAmelCase=2 ,					__UpperCAmelCase=768 ,					__UpperCAmelCase=12 ,					__UpperCAmelCase=64 ,					__UpperCAmelCase=3072 ,					__UpperCAmelCase="gelu_new" ,					__UpperCAmelCase=0.1 ,					__UpperCAmelCase=0.1 ,					__UpperCAmelCase=0.0 ,					__UpperCAmelCase=0.1 ,					__UpperCAmelCase=None ,					__UpperCAmelCase=1E-9 ,					__UpperCAmelCase="mean" ,					__UpperCAmelCase="relative_shift" ,					__UpperCAmelCase=True ,					__UpperCAmelCase=True ,					__UpperCAmelCase=True ,					**__UpperCAmelCase ,					):







											"""simple docstring"""



											a__	:							List[Any]      						= vocab_size
											a__	:							str      						= block_sizes
											a__	:							List[str]      						= [1] * len(__UpperCAmelCase				) if block_repeats is None else block_repeats
											assert len(__UpperCAmelCase				) == len(
											    self.block_repeats				), "`block_sizes` and `block_repeats` should have the same length."
											a__	:							str      						= num_decoder_layers
											a__	:							Any      						= d_model
											a__	:							Optional[int]      						= n_head
											a__	:							Optional[int]      						= d_head
											a__	:							List[str]      						= d_inner
											a__	:							Optional[int]      						= hidden_act
											a__	:							str      						= hidden_dropout
											a__	:							List[Any]      						= attention_dropout
											a__	:							Dict      						= activation_dropout
											a__	:							Optional[Any]      						= initializer_range
											a__	:							Any      						= initializer_std
											a__	:							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.'
											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__	:							Optional[Any]      						= attention_type
											a__	:							int      						= separate_cls
											a__	:							List[str]      						= truncate_seq
											a__	:							Optional[Any]      						= pool_q_only

											super().__init__(**__UpperCAmelCase				)



							@property
							def 		_A	(							self				):







											"""simple docstring"""



											return sum(self.block_sizes				)



							@num_hidden_layers.setter
							def 		_A	(							self ,					__UpperCAmelCase				):







											"""simple docstring"""



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



							@property
							def 		_A	(							self				):







											"""simple docstring"""



											return len(self.block_sizes				)




							@num_blocks.setter
							def 		_A	(							self ,					__UpperCAmelCase				):







											"""simple docstring"""



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







# this script reports modified .py files under the desired list of top-level sub-dirs passed as a list of arguments, e.g.:
#   python ./utils/get_modified_files.py utils src tests examples
#
# it uses git to find the forking point and which files were modified - i.e. files not under git won't be considered
# since the output of this script is fed into Makefile commands it doesn't print a newline after the results

import re
import subprocess
import sys


lowerCamelCase		       =      subprocess.check_output("""git merge-base main HEAD""".split()).decode("""utf-8""")
lowerCamelCase		       =      subprocess.check_output(F'git diff --name-only {fork_point_sha}'.split()).decode("""utf-8""").split()

lowerCamelCase		       =      """|""".join(sys.argv[1:])
lowerCamelCase		       =      re.compile(RF'^({joined_dirs}).*?\.py$')

lowerCamelCase		       =      [x for x in modified_files if regex.match(x)]
print(""" """.join(relevant_modified_files), end="""""")


