



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


lowercase_						=       logging.get_logger(__name__)

lowercase_						=       {
    'weiweishi/roc-bert-base-zh': 'https://huggingface.co/weiweishi/roc-bert-base-zh/resolve/main/config.json',
}
class 			_snake_case     (   _lowerCamelCase):
    UpperCamelCase__			:   Optional[Any]       						="""roc_bert"""




    def __init__(  self   :  Union[str, Any],   __lowercase   :  str=3_0522,   __lowercase   :  int=768,   __lowercase   :  Dict=12,   __lowercase   :  int=12,   __lowercase   :  Dict=3072,   __lowercase   :  Dict="gelu",   __lowercase   :  Optional[Any]=0.1,   __lowercase   :  int=0.1,   __lowercase   :  Dict=512,   __lowercase   :  int=2,   __lowercase   :  Union[str, Any]=0.02,   __lowercase   :  str=1e-1_2,   __lowercase   :  Any=True,   __lowercase   :  Any=0,   __lowercase   :  Optional[int]="absolute",   __lowercase   :  Dict=None,   __lowercase   :  Tuple=True,   __lowercase   :  Tuple=True,   __lowercase   :  Tuple=768,   __lowercase   :  str=910,   __lowercase   :  Tuple=512,   __lowercase   :  Tuple=2_4858,   __lowercase   :  List[str]=True,   **__lowercase   :  int,   ):
       lowercase__   					=			vocab_size
       lowercase__   					=			max_position_embeddings
       lowercase__   					=			hidden_size
       lowercase__   					=			num_hidden_layers
       lowercase__   					=			num_attention_heads
       lowercase__   					=			intermediate_size
       lowercase__   					=			hidden_act
       lowercase__   					=			hidden_dropout_prob
       lowercase__   					=			attention_probs_dropout_prob
       lowercase__   					=			initializer_range
       lowercase__   					=			type_vocab_size
       lowercase__   					=			layer_norm_eps
       lowercase__   					=			use_cache
       lowercase__   					=			enable_pronunciation
       lowercase__   					=			enable_shape
       lowercase__   					=			pronunciation_embed_dim
       lowercase__   					=			pronunciation_vocab_size
       lowercase__   					=			shape_embed_dim
       lowercase__   					=			shape_vocab_size
       lowercase__   					=			concat_input
       lowercase__   					=			position_embedding_type
       lowercase__   					=			classifier_dropout
       super().__init__(pad_token_id=__lowercase,   **__lowercase  )









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


lowercase_						=       logging.get_logger(__name__)

lowercase_						=       {
    """facebook/nllb-moe-54B""": """https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json""",
}
class 			_snake_case     (   lowercase__):
				UpperCamelCase__			:   Tuple       						="""nllb-moe"""
				UpperCamelCase__			:   Dict       						=["""past_key_values"""]
				UpperCamelCase__			:   List[Any]       						={"""num_attention_heads""": """encoder_attention_heads""", """hidden_size""": """d_model"""}




				def __init__(  self   :  List[str],   __lowercase   :  str=12_8112,   __lowercase   :  List[Any]=1024,   __lowercase   :  int=12,   __lowercase   :  Union[str, Any]=4096,   __lowercase   :  Union[str, Any]=16,   __lowercase   :  Tuple=12,   __lowercase   :  int=4096,   __lowercase   :  Any=16,   __lowercase   :  List[str]=0.05,   __lowercase   :  Optional[int]=0.05,   __lowercase   :  int=True,   __lowercase   :  Optional[Any]=True,   __lowercase   :  Optional[Any]="relu",   __lowercase   :  str=1024,   __lowercase   :  Optional[Any]=0.1,   __lowercase   :  List[Any]=0.1,   __lowercase   :  Union[str, Any]=0.0,   __lowercase   :  Tuple=0.02,   __lowercase   :  Optional[Any]=2,   __lowercase   :  Optional[int]=True,   __lowercase   :  List[Any]=False,   __lowercase   :  Any="float32",   __lowercase   :  Union[str, Any]=False,   __lowercase   :  Optional[int]=128,   __lowercase   :  Union[str, Any]=64,   __lowercase   :  Optional[int]=4,   __lowercase   :  Dict=4,   __lowercase   :  Any=0.001,   __lowercase   :  Optional[int]=0.001,   __lowercase   :  int="all",   __lowercase   :  Any=False,   __lowercase   :  Optional[int]=False,   __lowercase   :  Dict=1.0,   __lowercase   :  int=0.2,   __lowercase   :  str=1,   __lowercase   :  Optional[Any]=0,   __lowercase   :  Optional[int]=2,   __lowercase   :  Any=False,   **__lowercase   :  List[str],   ):
							lowercase__   					=			vocab_size
							lowercase__   					=			max_position_embeddings
							lowercase__   					=			d_model
							lowercase__   					=			encoder_ffn_dim
							lowercase__   					=			encoder_layers
							lowercase__   					=			encoder_attention_heads
							lowercase__   					=			decoder_ffn_dim
							lowercase__   					=			decoder_layers
							lowercase__   					=			decoder_attention_heads
							lowercase__   					=			dropout
							lowercase__   					=			attention_dropout
							lowercase__   					=			activation_dropout
							lowercase__   					=			activation_function
							lowercase__   					=			init_std
							lowercase__   					=			encoder_layerdrop
							lowercase__   					=			decoder_layerdrop
							lowercase__   					=			use_cache
							lowercase__   					=			encoder_layers
							lowercase__   					=			scale_embedding  # scale factor will be sqrt(d_model) if True
							lowercase__   					=			router_z_loss_coef
							lowercase__   					=			router_aux_loss_coef
							lowercase__   					=			decoder_sparse_step
							lowercase__   					=			encoder_sparse_step
							lowercase__   					=			num_experts
							lowercase__   					=			expert_capacity
							lowercase__   					=			router_bias
							if router_dtype not in ["float32", "float16", "bfloat16"]:
										raise ValueError(F'''`router_dtype` must be one of \'float32\', \'float16\' or \'bfloat16\', got {router_dtype}'''  )
							lowercase__   					=			router_dtype

							lowercase__   					=			router_ignore_padding_tokens
							lowercase__   					=			batch_prioritized_routing
							lowercase__   					=			second_expert_policy
							lowercase__   					=			normalize_router_prob_before_dropping
							lowercase__   					=			moe_eval_capacity_token_fraction
							lowercase__   					=			moe_token_dropout
							lowercase__   					=			output_router_logits
							super().__init__(
							    pad_token_id=__lowercase,   bos_token_id=__lowercase,   eos_token_id=__lowercase,   is_encoder_decoder=__lowercase,   decoder_start_token_id=__lowercase,   **__lowercase,   )




