



import warnings

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


A__  :  Tuple								=					logging.get_logger(__name__)

A__  :  Optional[Any]								=					{
    '''xlnet-base-cased''': '''https://huggingface.co/xlnet-base-cased/resolve/main/config.json''',
    '''xlnet-large-cased''': '''https://huggingface.co/xlnet-large-cased/resolve/main/config.json''',
}



class 				__snake_case						(     UpperCamelCase_						):
							_a			      = '''xlnet'''
							_a			      = ['''mems''']
							_a			      = {
							    '''n_token''': '''vocab_size''',  # Backward compatibility
							    '''hidden_size''': '''d_model''',
							    '''num_attention_heads''': '''n_head''',
							    '''num_hidden_layers''': '''n_layer''',
							}




							def __init__(       self     :       str				,				A_     :       Any=3_2_0_0_0				,				A_     :       Optional[int]=1_0_2_4				,				A_     :       List[str]=2_4				,				A_     :       str=1_6				,				A_     :       Optional[int]=4_0_9_6				,				A_     :       Optional[int]="gelu"				,				A_     :       Any=True				,				A_     :       Tuple="bi"				,				A_     :       List[str]=0.02				,				A_     :       Any=1e-12				,				A_     :       str=0.1				,				A_     :       Any=5_1_2				,				A_     :       Optional[Any]=None				,				A_     :       int=True				,				A_     :       Any=False				,				A_     :       Dict=False				,				A_     :       Any=-1				,				A_     :       int=False				,				A_     :       Optional[int]="last"				,				A_     :       List[str]=True				,				A_     :       Optional[int]="tanh"				,				A_     :       Dict=0.1				,				A_     :       int=5				,				A_     :       Optional[int]=5				,				A_     :       Tuple=5				,				A_     :       Tuple=1				,				A_     :       Optional[int]=2				,				**A_     :       Optional[int]				,				):
									lowerCAmelCase_			:     Dict									= vocab_size
									lowerCAmelCase_			:     Optional[int]									= d_model
									lowerCAmelCase_			:     Tuple									= n_layer
									lowerCAmelCase_			:     str									= n_head
									if d_model % n_head != 0:
											raise ValueError(F"""'d_model % n_head' ({d_model % n_head}) should be equal to 0""")
									if "d_head" in kwargs:
											if kwargs["d_head"] != d_model // n_head:
													raise ValueError(
													    F"""`d_head` ({kwargs["d_head"]}) should be equal to `d_model // n_head` ({d_model // n_head})""")
									lowerCAmelCase_			:     Optional[int]									= d_model // n_head
									lowerCAmelCase_			:     str									= ff_activation
									lowerCAmelCase_			:     int									= d_inner
									lowerCAmelCase_			:     List[str]									= untie_r
									lowerCAmelCase_			:     Dict									= attn_type

									lowerCAmelCase_			:     Union[str, Any]									= initializer_range
									lowerCAmelCase_			:     Tuple									= layer_norm_eps

									lowerCAmelCase_			:     Union[str, Any]									= dropout
									lowerCAmelCase_			:     Tuple									= mem_len
									lowerCAmelCase_			:     Union[str, Any]									= reuse_len
									lowerCAmelCase_			:     str									= bi_data
									lowerCAmelCase_			:     str									= clamp_len
									lowerCAmelCase_			:     Any									= same_length

									lowerCAmelCase_			:     Union[str, Any]									= summary_type
									lowerCAmelCase_			:     str									= summary_use_proj
									lowerCAmelCase_			:     str									= summary_activation
									lowerCAmelCase_			:     List[Any]									= summary_last_dropout
									lowerCAmelCase_			:     int									= start_n_top
									lowerCAmelCase_			:     Optional[int]									= end_n_top

									lowerCAmelCase_			:     Union[str, Any]									= bos_token_id
									lowerCAmelCase_			:     Tuple									= pad_token_id
									lowerCAmelCase_			:     Optional[int]									= eos_token_id

									if "use_cache" in kwargs:
											warnings.warn(
											    '''The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'''
											    ''' instead.'''				,				A_				,				)
											lowerCAmelCase_			:     str									= kwargs['''use_cache''']

									lowerCAmelCase_			:     Optional[int]									= use_mems_eval
									lowerCAmelCase_			:     str									= use_mems_train
									super().__init__(pad_token_id=A_				,				bos_token_id=A_				,				eos_token_id=A_				,				**A_)




							@property
							def    UpperCAmelCase__			(       self     :       Tuple):
									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    UpperCAmelCase__			(       self     :       Dict				,				A_     :       Any):
									# 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


A__  :  List[str]								=					logging.get_logger(__name__)

A__  :  int								=					{
    '''weiweishi/roc-bert-base-zh''': '''https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json''',
}



class 				__snake_case						(     UpperCamelCase_						):
							_a			      = '''roc_bert'''




							def __init__(       self     :       List[Any]				,				A_     :       Optional[Any]=3_0_5_2_2				,				A_     :       List[str]=7_6_8				,				A_     :       Tuple=1_2				,				A_     :       List[str]=1_2				,				A_     :       List[str]=3_0_7_2				,				A_     :       Any="gelu"				,				A_     :       str=0.1				,				A_     :       int=0.1				,				A_     :       Optional[int]=5_1_2				,				A_     :       int=2				,				A_     :       List[str]=0.02				,				A_     :       Union[str, Any]=1e-12				,				A_     :       Union[str, Any]=True				,				A_     :       Tuple=0				,				A_     :       Union[str, Any]="absolute"				,				A_     :       Optional[Any]=None				,				A_     :       Any=True				,				A_     :       Optional[int]=True				,				A_     :       List[Any]=7_6_8				,				A_     :       str=9_1_0				,				A_     :       Dict=5_1_2				,				A_     :       Optional[int]=2_4_8_5_8				,				A_     :       Optional[Any]=True				,				**A_     :       Dict				,				):
									lowerCAmelCase_			:     List[str]									= vocab_size
									lowerCAmelCase_			:     Any									= max_position_embeddings
									lowerCAmelCase_			:     Dict									= hidden_size
									lowerCAmelCase_			:     Union[str, Any]									= num_hidden_layers
									lowerCAmelCase_			:     Tuple									= num_attention_heads
									lowerCAmelCase_			:     int									= intermediate_size
									lowerCAmelCase_			:     Tuple									= hidden_act
									lowerCAmelCase_			:     List[str]									= hidden_dropout_prob
									lowerCAmelCase_			:     Tuple									= attention_probs_dropout_prob
									lowerCAmelCase_			:     Any									= initializer_range
									lowerCAmelCase_			:     Union[str, Any]									= type_vocab_size
									lowerCAmelCase_			:     Union[str, Any]									= layer_norm_eps
									lowerCAmelCase_			:     Optional[int]									= use_cache
									lowerCAmelCase_			:     Tuple									= enable_pronunciation
									lowerCAmelCase_			:     Optional[Any]									= enable_shape
									lowerCAmelCase_			:     Union[str, Any]									= pronunciation_embed_dim
									lowerCAmelCase_			:     List[Any]									= pronunciation_vocab_size
									lowerCAmelCase_			:     Tuple									= shape_embed_dim
									lowerCAmelCase_			:     str									= shape_vocab_size
									lowerCAmelCase_			:     Optional[int]									= concat_input
									lowerCAmelCase_			:     Optional[Any]									= position_embedding_type
									lowerCAmelCase_			:     Optional[Any]									= classifier_dropout
									super().__init__(pad_token_id=A_				,				**A_)





