




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


__UpperCAmelCase          =       logging.get_logger(__name__)

__UpperCAmelCase          =       {
    '''google/canine-s''': '''https://huggingface.co/google/canine-s/resolve/main/config.json''',
    # See all CANINE models at https://huggingface.co/models?filter=canine
}



class 				lowerCAmelCase_		(  a__							):
       UpperCAmelCase__				:					Any        =  "canine"
       def __init__(			self,			SCREAMING_SNAKE_CASE_=768,			SCREAMING_SNAKE_CASE_=12,			SCREAMING_SNAKE_CASE_=12,			SCREAMING_SNAKE_CASE_=3072,			SCREAMING_SNAKE_CASE_="gelu",			SCREAMING_SNAKE_CASE_=0.1,			SCREAMING_SNAKE_CASE_=0.1,			SCREAMING_SNAKE_CASE_=1_6384,			SCREAMING_SNAKE_CASE_=16,			SCREAMING_SNAKE_CASE_=0.02,			SCREAMING_SNAKE_CASE_=1e-12,			SCREAMING_SNAKE_CASE_=0,			SCREAMING_SNAKE_CASE_=0XE000,			SCREAMING_SNAKE_CASE_=0XE001,			SCREAMING_SNAKE_CASE_=4,			SCREAMING_SNAKE_CASE_=4,			SCREAMING_SNAKE_CASE_=8,			SCREAMING_SNAKE_CASE_=1_6384,			SCREAMING_SNAKE_CASE_=128,			**SCREAMING_SNAKE_CASE_,			)     ->		int:
          super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_,			bos_token_id=SCREAMING_SNAKE_CASE_,			eos_token_id=SCREAMING_SNAKE_CASE_,			**SCREAMING_SNAKE_CASE_       )

          UpperCamelCase    :  Tuple							=	max_position_embeddings
          UpperCamelCase    :  Tuple							=	hidden_size
          UpperCamelCase    :  Union[str, Any]							=	num_hidden_layers
          UpperCamelCase    :  Optional[int]							=	num_attention_heads
          UpperCamelCase    :  Tuple							=	intermediate_size
          UpperCamelCase    :  List[str]							=	hidden_act
          UpperCamelCase    :  Union[str, Any]							=	hidden_dropout_prob
          UpperCamelCase    :  Optional[int]							=	attention_probs_dropout_prob
          UpperCamelCase    :  Optional[Any]							=	initializer_range
          UpperCamelCase    :  Tuple							=	type_vocab_size
          UpperCamelCase    :  Any							=	layer_norm_eps

          # Character config:
          UpperCamelCase    :  List[Any]							=	downsampling_rate
          UpperCamelCase    :  Optional[int]							=	upsampling_kernel_size
          UpperCamelCase    :  Tuple							=	num_hash_functions
          UpperCamelCase    :  Union[str, Any]							=	num_hash_buckets
          UpperCamelCase    :  str							=	local_transformer_stride



