




'''simple docstring'''







from typing import Callable, Optional, Union

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


_lowerCamelCase							:						Optional[int]							     =  logging.get_logger(__name__)

_lowerCamelCase							:						Dict							     =  {
    'microsoft/prophetnet-large-uncased': (
        'https://huggingface.co/microsoft/prophetnet-large-uncased/resolve/main/config.json'
    ),
}





class 					lowerCamelCase_							(	UpperCAmelCase_							):




					'''simple docstring'''






					lowercase__   =			"""prophetnet"""
					lowercase__   =			["""past_key_values"""]
					lowercase__   =			{
					    """num_attention_heads""": """num_encoder_attention_heads""",
					}






					def __init__(   self,  __UpperCamelCase = 0.1,  __UpperCamelCase = "gelu",  __UpperCamelCase = 30_522,  __UpperCamelCase = 1_024,  __UpperCamelCase = 4_096,  __UpperCamelCase = 12,  __UpperCamelCase = 16,  __UpperCamelCase = 4_096,  __UpperCamelCase = 12,  __UpperCamelCase = 16,  __UpperCamelCase = 0.1,  __UpperCamelCase = 0.1,  __UpperCamelCase = 512,  __UpperCamelCase = 0.02,  __UpperCamelCase = True,  __UpperCamelCase = True,  __UpperCamelCase = 0,  __UpperCamelCase = 2,  __UpperCamelCase = 32,  __UpperCamelCase = 128,  __UpperCamelCase = False,  __UpperCamelCase = 0.0,  __UpperCamelCase = True,  __UpperCamelCase = 0,  __UpperCamelCase = 1,  __UpperCamelCase = 2,  **__UpperCamelCase,  ):
							_snake_case     	=	vocab_size
							_snake_case     	=	hidden_size
							_snake_case     	=	encoder_ffn_dim
							_snake_case     	=	num_encoder_layers
							_snake_case     	=	num_encoder_attention_heads
							_snake_case     	=	decoder_ffn_dim
							_snake_case     	=	num_decoder_layers
							_snake_case     	=	num_decoder_attention_heads
							_snake_case     	=	max_position_embeddings
							_snake_case     	=	init_std  # Normal(0, this parameter)
							_snake_case     	=	activation_function

							# parameters for prophetnet
							_snake_case     	=	ngram
							_snake_case     	=	num_buckets
							_snake_case     	=	relative_max_distance
							_snake_case     	=	disable_ngram_loss
							_snake_case     	=	eps

							# 3 Types of Dropout
							_snake_case     	=	attention_dropout
							_snake_case     	=	activation_dropout
							_snake_case     	=	dropout

							_snake_case     	=	use_cache

							super().__init__(
							    pad_token_id=__UpperCamelCase,  bos_token_id=__UpperCamelCase,  eos_token_id=__UpperCamelCase,  is_encoder_decoder=__UpperCamelCase,  add_cross_attention=__UpperCamelCase,  decoder_start_token_id=__UpperCamelCase,  **__UpperCamelCase,  )






					@property
					def     __SCREAMING_SNAKE_CASE     (   self			):
							return self.num_encoder_layers + self.num_decoder_layers






					@num_hidden_layers.setter
					def     __SCREAMING_SNAKE_CASE     (   self,  __UpperCamelCase			):
							raise NotImplementedError(
							    "This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"
							    " `num_decoder_layers`."			)











'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowerCamelCase							:						List[Any]							     =  {
    'configuration_mobilenet_v1': [
        'MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'MobileNetV1Config',
        'MobileNetV1OnnxConfig',
    ],
}

try:
						if not is_vision_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCamelCase							:						str							     =  ['MobileNetV1FeatureExtractor']
						_lowerCamelCase							:						Tuple							     =  ['MobileNetV1ImageProcessor']

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowerCamelCase							:						List[Any]							     =  [
						    'MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST',
						    'MobileNetV1ForImageClassification',
						    'MobileNetV1Model',
						    'MobileNetV1PreTrainedModel',
						    'load_tf_weights_in_mobilenet_v1',
						]


if TYPE_CHECKING:
						from .configuration_mobilenet_va import (
						    MOBILENET_V1_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    MobileNetVaConfig,
						    MobileNetVaOnnxConfig,
						)

						try:
												if not is_vision_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .feature_extraction_mobilenet_va import MobileNetVaFeatureExtractor
												from .image_processing_mobilenet_va import MobileNetVaImageProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mobilenet_va import (
												    MOBILENET_V1_PRETRAINED_MODEL_ARCHIVE_LIST,
												    MobileNetVaForImageClassification,
												    MobileNetVaModel,
												    MobileNetVaPreTrainedModel,
												    load_tf_weights_in_mobilenet_va,
												)


else:
						import sys

						_lowerCamelCase							:						Union[str, Any]							     =  _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





