




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


_snake_case										=       logging.get_logger(__name__)

_snake_case										=       {
    "transfo-xl-wt103": "https://huggingface.co/transfo-xl-wt103/resolve/main/config.json",
}







class 						lowercase							(   UpperCamelCase__		):
     _a							 =						"transfo-xl"
     _a							 =						["mems"]
     _a							 =						{
         "n_token": "vocab_size",
         "hidden_size": "d_model",
         "num_attention_heads": "n_head",
         "num_hidden_layers": "n_layer",
     }

     def __init__(  self		,     _a=26_7735		,     _a=[2_0000, 4_0000, 20_0000]		,     _a=1024		,     _a=1024		,     _a=16		,     _a=64		,     _a=4096		,     _a=4		,     _a=False		,     _a=18		,     _a=1600		,     _a=1000		,     _a=True		,     _a=True		,     _a=0		,     _a=-1		,     _a=True		,     _a=0.1		,     _a=0.0		,     _a=True		,     _a="normal"		,     _a=0.01		,     _a=0.01		,     _a=0.02		,     _a=1e-5		,     _a=0		,     **_a		,     )						->							Tuple:
           _A							:     Union[str, Any]			=						vocab_size
           _A							:     Union[str, Any]			=						[]
           self.cutoffs.extend(_a				)
           if proj_share_all_but_first:
                 _A							:     Union[str, Any]			=						[False] + [True] * len(self.cutoffs				)
           else:
                 _A							:     Dict			=						[False] + [False] * len(self.cutoffs				)
           _A							:     List[str]			=						d_model
           _A							:     Dict			=						d_embed
           _A							:     Dict			=						d_head
           _A							:     Optional[int]			=						d_inner
           _A							:     Tuple			=						div_val
           _A							:     Union[str, Any]			=						pre_lnorm
           _A							:     Union[str, Any]			=						n_layer
           _A							:     str			=						n_head
           _A							:     Optional[Any]			=						mem_len
           _A							:     Tuple			=						same_length
           _A							:     Optional[int]			=						attn_type
           _A							:     Any			=						clamp_len
           _A							:     Dict			=						sample_softmax
           _A							:     Any			=						adaptive
           _A							:     List[str]			=						dropout
           _A							:     List[str]			=						dropatt
           _A							:     Union[str, Any]			=						untie_r
           _A							:     Optional[int]			=						init
           _A							:     Union[str, Any]			=						init_range
           _A							:     Tuple			=						proj_init_std
           _A							:     int			=						init_std
           _A							:     List[str]			=						layer_norm_epsilon
           super().__init__(eos_token_id=_a		,     **_a				)

     @property
     def 					a__	(  self				)						->							int:
           # Message copied from Transformer-XL documentation
           logger.info(F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)
           return -1



     @max_position_embeddings.setter
     def 					a__	(  self		,     _a				)						->							Tuple:
           # Message copied from Transformer-XL documentation
           raise NotImplementedError(
               F'''The model {self.model_type} is one of the few models that has no sequence length limit.'''				)







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


_snake_case										=       logging.get_logger(__name__)

_snake_case										=       {
    "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json",
    "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json"
    # See all FNet models at https://huggingface.co/models?filter=fnet
}







class 						lowercase							(   UpperCamelCase__		):
     _a							 =						"fnet"

     def __init__(  self		,     _a=3_2000		,     _a=768		,     _a=12		,     _a=3072		,     _a="gelu_new"		,     _a=0.1		,     _a=512		,     _a=4		,     _a=0.02		,     _a=1e-12		,     _a=False		,     _a=512		,     _a=3		,     _a=1		,     _a=2		,     **_a		,     )						->							int:
           super().__init__(pad_token_id=_a		,     bos_token_id=_a		,     eos_token_id=_a		,     **_a				)

           _A							:     Any			=						vocab_size
           _A							:     str			=						max_position_embeddings
           _A							:     Optional[Any]			=						hidden_size
           _A							:     List[str]			=						num_hidden_layers
           _A							:     List[str]			=						intermediate_size
           _A							:     List[Any]			=						hidden_act
           _A							:     List[str]			=						hidden_dropout_prob
           _A							:     List[str]			=						initializer_range
           _A							:     List[Any]			=						type_vocab_size
           _A							:     List[Any]			=						layer_norm_eps
           _A							:     List[str]			=						use_tpu_fourier_optimizations
           _A							:     str			=						tpu_short_seq_length

