



'''simple docstring'''

from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


snake_case_			=     logging.get_logger(__name__)

snake_case_			=     {
    """google/mobilenet_v2_1.4_224""": """https://huggingface.co/google/mobilenet_v2_1.4_224/resolve/main/config.json""",
    """google/mobilenet_v2_1.0_224""": """https://huggingface.co/google/mobilenet_v2_1.0_224/resolve/main/config.json""",
    """google/mobilenet_v2_0.75_160""": """https://huggingface.co/google/mobilenet_v2_0.75_160/resolve/main/config.json""",
    """google/mobilenet_v2_0.35_96""": """https://huggingface.co/google/mobilenet_v2_0.35_96/resolve/main/config.json""",
    # See all MobileNetV2 models at https://huggingface.co/models?filter=mobilenet_v2
}


class 	a__     (				_lowercase	):
	__magic_name__		:    List[Any]	    =     "mobilenet_v2"


	def __init__(self : str,					__UpperCAmelCase : int=3,					__UpperCAmelCase : Optional[Any]=224,					__UpperCAmelCase : Dict=1.0,					__UpperCAmelCase : Union[str, Any]=8,					__UpperCAmelCase : int=8,					__UpperCAmelCase : Union[str, Any]=6,					__UpperCAmelCase : Any=32,					__UpperCAmelCase : int=True,					__UpperCAmelCase : Optional[Any]=True,					__UpperCAmelCase : int="relu6",					__UpperCAmelCase : List[Any]=True,					__UpperCAmelCase : List[str]=0.8,					__UpperCAmelCase : Union[str, Any]=0.02,					__UpperCAmelCase : List[Any]=0.001,					__UpperCAmelCase : List[str]=255,					**__UpperCAmelCase : Dict,					)     ->			str:

					"""simple docstring"""

					super().__init__(**__UpperCAmelCase      )

					if depth_multiplier <= 0:
									raise ValueError('''depth_multiplier must be greater than zero.'''      )

					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= num_channels
					SCREAMING_SNAKE_CASE  :						int      					= image_size
					SCREAMING_SNAKE_CASE  :						int      					= depth_multiplier
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= depth_divisible_by
					SCREAMING_SNAKE_CASE  :						Any      					= min_depth
					SCREAMING_SNAKE_CASE  :						str      					= expand_ratio
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= output_stride
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= first_layer_is_expansion
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= finegrained_output
					SCREAMING_SNAKE_CASE  :						Optional[int]      					= hidden_act
					SCREAMING_SNAKE_CASE  :						Dict      					= tf_padding
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= classifier_dropout_prob
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= initializer_range
					SCREAMING_SNAKE_CASE  :						Tuple      					= layer_norm_eps
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= semantic_loss_ignore_index



class 	a__     (				_lowercase	):
	__magic_name__		:    Union[str, Any]	    =     version.parse("1.11"	)


	@property
	def 				lowercase__  (self : List[str]      )     ->			Mapping[str, Mapping[int, str]]:

					"""simple docstring"""

					return OrderedDict([('''pixel_values''', {0: '''batch'''})]      )


	@property
	def 				lowercase__  (self : Any      )     ->			Mapping[str, Mapping[int, str]]:

					"""simple docstring"""

					if self.task == "image-classification":
									return OrderedDict([('''logits''', {0: '''batch'''})]      )
					else:
									return OrderedDict([('''last_hidden_state''', {0: '''batch'''}), ('''pooler_output''', {0: '''batch'''})]      )






	@property
	def 				lowercase__  (self : List[str]      )     ->			float:

					"""simple docstring"""

					return 1e-4









'''simple docstring'''

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


snake_case_			=     logging.get_logger(__name__)

snake_case_			=     {
    """facebook/nllb-moe-54B""": """https://huggingface.co/facebook/nllb-moe-54b/resolve/main/config.json""",
}


class 	a__     (				_lowercase	):
	__magic_name__		:    Optional[Any]	    =     "nllb-moe"
	__magic_name__		:    Optional[Any]	    =     ["past_key_values"]
	__magic_name__		:    Optional[int]	    =     {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}


	def __init__(self : int,					__UpperCAmelCase : Tuple=128112,					__UpperCAmelCase : Any=1024,					__UpperCAmelCase : Optional[Any]=12,					__UpperCAmelCase : Optional[int]=4096,					__UpperCAmelCase : Any=16,					__UpperCAmelCase : Any=12,					__UpperCAmelCase : Optional[Any]=4096,					__UpperCAmelCase : Optional[int]=16,					__UpperCAmelCase : List[Any]=0.05,					__UpperCAmelCase : Dict=0.05,					__UpperCAmelCase : Dict=True,					__UpperCAmelCase : List[Any]=True,					__UpperCAmelCase : Any="relu",					__UpperCAmelCase : Union[str, Any]=1024,					__UpperCAmelCase : Optional[int]=0.1,					__UpperCAmelCase : Tuple=0.1,					__UpperCAmelCase : List[Any]=0.0,					__UpperCAmelCase : Optional[int]=0.02,					__UpperCAmelCase : Tuple=2,					__UpperCAmelCase : int=True,					__UpperCAmelCase : int=False,					__UpperCAmelCase : int="float32",					__UpperCAmelCase : Optional[Any]=False,					__UpperCAmelCase : List[str]=128,					__UpperCAmelCase : Dict=64,					__UpperCAmelCase : Dict=4,					__UpperCAmelCase : Optional[Any]=4,					__UpperCAmelCase : Optional[Any]=0.001,					__UpperCAmelCase : Optional[Any]=0.001,					__UpperCAmelCase : Optional[Any]="all",					__UpperCAmelCase : List[str]=False,					__UpperCAmelCase : Dict=False,					__UpperCAmelCase : Any=1.0,					__UpperCAmelCase : Dict=0.2,					__UpperCAmelCase : int=1,					__UpperCAmelCase : Union[str, Any]=0,					__UpperCAmelCase : Any=2,					__UpperCAmelCase : Union[str, Any]=False,					**__UpperCAmelCase : Dict,					)     ->			List[Any]:

					"""simple docstring"""

					SCREAMING_SNAKE_CASE  :						Any      					= vocab_size
					SCREAMING_SNAKE_CASE  :						int      					= max_position_embeddings
					SCREAMING_SNAKE_CASE  :						Optional[int]      					= d_model
					SCREAMING_SNAKE_CASE  :						Dict      					= encoder_ffn_dim
					SCREAMING_SNAKE_CASE  :						int      					= encoder_layers
					SCREAMING_SNAKE_CASE  :						str      					= encoder_attention_heads
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= decoder_ffn_dim
					SCREAMING_SNAKE_CASE  :						str      					= decoder_layers
					SCREAMING_SNAKE_CASE  :						Dict      					= decoder_attention_heads
					SCREAMING_SNAKE_CASE  :						Dict      					= dropout
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= attention_dropout
					SCREAMING_SNAKE_CASE  :						Dict      					= activation_dropout
					SCREAMING_SNAKE_CASE  :						List[str]      					= activation_function
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= init_std
					SCREAMING_SNAKE_CASE  :						Any      					= encoder_layerdrop
					SCREAMING_SNAKE_CASE  :						Optional[int]      					= decoder_layerdrop
					SCREAMING_SNAKE_CASE  :						Dict      					= use_cache
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= encoder_layers
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= scale_embedding  # scale factor will be sqrt(d_model) if True
					SCREAMING_SNAKE_CASE  :						List[str]      					= router_z_loss_coef
					SCREAMING_SNAKE_CASE  :						List[str]      					= router_aux_loss_coef
					SCREAMING_SNAKE_CASE  :						int      					= decoder_sparse_step
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= encoder_sparse_step
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= num_experts
					SCREAMING_SNAKE_CASE  :						List[Any]      					= expert_capacity
					SCREAMING_SNAKE_CASE  :						Optional[Any]      					= 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}'''      )
					SCREAMING_SNAKE_CASE  :						Union[str, Any]      					= router_dtype

					SCREAMING_SNAKE_CASE  :						int      					= router_ignore_padding_tokens
					SCREAMING_SNAKE_CASE  :						Dict      					= batch_prioritized_routing
					SCREAMING_SNAKE_CASE  :						Dict      					= second_expert_policy
					SCREAMING_SNAKE_CASE  :						Tuple      					= normalize_router_prob_before_dropping
					SCREAMING_SNAKE_CASE  :						List[str]      					= moe_eval_capacity_token_fraction
					SCREAMING_SNAKE_CASE  :						List[Any]      					= moe_token_dropout
					SCREAMING_SNAKE_CASE  :						List[Any]      					= output_router_logits
					super().__init__(
					    pad_token_id=__UpperCAmelCase,					bos_token_id=__UpperCAmelCase,					eos_token_id=__UpperCAmelCase,					is_encoder_decoder=__UpperCAmelCase,					decoder_start_token_id=__UpperCAmelCase,					**__UpperCAmelCase,					)




