






'''simple docstring'''


import copy

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


lowerCamelCase_					:			int     						=				logging.get_logger(__name__)

lowerCamelCase_					:			Optional[int]     						=				{}
class  _SCREAMING_SNAKE_CASE				(		SCREAMING_SNAKE_CASE						):


			'''simple docstring'''





			__a				:				Optional[int]         =       "fsmt_decoder"






			def __init__( self				:    List[str]			,   lowercase				:    int=0			,   lowercase				:    Union[str, Any]=0      )				->     List[str]:

									'''simple docstring'''







									super().__init__()
									UpperCamelCase__       =			vocab_size
									UpperCamelCase__       =			bos_token_id
class  _SCREAMING_SNAKE_CASE				(		SCREAMING_SNAKE_CASE						):


			'''simple docstring'''





			__a				:				Union[str, Any]         =       "fsmt"
			__a				:				Tuple         =       {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}






			def __init__( self				:    int			,   lowercase				:    Optional[int]=["en", "de"]			,   lowercase				:    List[str]=4_2_0_2_4			,   lowercase				:    List[Any]=4_2_0_2_4			,   lowercase				:    List[Any]="relu"			,   lowercase				:    Tuple=1_0_2_4			,   lowercase				:    str=2_0_0			,   lowercase				:    Dict=1_0_2_4			,   lowercase				:    List[str]=4_0_9_6			,   lowercase				:    Any=1_2			,   lowercase				:    Any=1_6			,   lowercase				:    List[Any]=0.0			,   lowercase				:    Any=4_0_9_6			,   lowercase				:    Tuple=1_2			,   lowercase				:    str=1_6			,   lowercase				:    Optional[Any]=0.0			,   lowercase				:    Union[str, Any]=0.0			,   lowercase				:    List[str]=0.1			,   lowercase				:    Optional[Any]=0.0			,   lowercase				:    List[str]=0.0_2			,   lowercase				:    Dict=2			,   lowercase				:    Tuple=True			,   lowercase				:    List[Any]=True			,   lowercase				:    List[Any]=False			,   lowercase				:    Optional[int]=5			,   lowercase				:    List[str]=1.0			,   lowercase				:    int=False			,   lowercase				:    str=True			,   lowercase				:    int=1			,   lowercase				:    Tuple=0			,   lowercase				:    Any=2			,   lowercase				:    Optional[Any]=2			,   **lowercase				:    List[str]			,   )				->     Optional[Any]:

									'''simple docstring'''







									UpperCamelCase__       =			langs
									UpperCamelCase__       =			src_vocab_size
									UpperCamelCase__       =			tgt_vocab_size
									UpperCamelCase__       =			d_model  # encoder_embed_dim and decoder_embed_dim

									UpperCamelCase__       =			encoder_ffn_dim
									UpperCamelCase__       =			UpperCamelCase__       =			encoder_layers
									UpperCamelCase__       =			encoder_attention_heads
									UpperCamelCase__       =			encoder_layerdrop
									UpperCamelCase__       =			decoder_layerdrop
									UpperCamelCase__       =			decoder_ffn_dim
									UpperCamelCase__       =			decoder_layers
									UpperCamelCase__       =			decoder_attention_heads
									UpperCamelCase__       =			max_position_embeddings
									UpperCamelCase__       =			init_std  # Normal(0, this parameter)
									UpperCamelCase__       =			activation_function

									UpperCamelCase__       =			DecoderConfig(vocab_size=lowercase			,   bos_token_id=lowercase      )
									if "decoder" in common_kwargs:
															del common_kwargs["decoder"]

									UpperCamelCase__       =			scale_embedding  # scale factor will be sqrt(d_model) if True

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

									UpperCamelCase__       =			use_cache
									super().__init__(
									    pad_token_id=lowercase			,   bos_token_id=lowercase			,   eos_token_id=lowercase			,   decoder_start_token_id=lowercase			,   is_encoder_decoder=lowercase			,   tie_word_embeddings=lowercase			,   forced_eos_token_id=lowercase			,   max_length=lowercase			,   num_beams=lowercase			,   length_penalty=lowercase			,   early_stopping=lowercase			,   **lowercase			,   )







			def 					A   ( self				:    Dict      )				->     List[Any]:

									'''simple docstring'''







									UpperCamelCase__       =			copy.deepcopy(self.__dict__      )
									UpperCamelCase__       =			self.decoder.to_dict()
									UpperCamelCase__       =			self.__class__.model_type
									return output








'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


lowerCamelCase_					:			Any     						=				{
    '''configuration_sam''': [
        '''SAM_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''SamConfig''',
        '''SamMaskDecoderConfig''',
        '''SamPromptEncoderConfig''',
        '''SamVisionConfig''',
    ],
    '''processing_sam''': ['''SamProcessor'''],
}


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase_					:			Union[str, Any]     						=				[
					    '''SAM_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''SamModel''',
					    '''SamPreTrainedModel''',
					]
try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase_					:			Optional[Any]     						=				[
					    '''TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TFSamModel''',
					    '''TFSamPreTrainedModel''',
					]
try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowerCamelCase_					:			Optional[Any]     						=				['''SamImageProcessor''']


if TYPE_CHECKING:
					from .configuration_sam import (
					    SAM_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    SamConfig,
					    SamMaskDecoderConfig,
					    SamPromptEncoderConfig,
					    SamVisionConfig,
					)
					from .processing_sam import SamProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_sam import SAM_PRETRAINED_MODEL_ARCHIVE_LIST, SamModel, SamPreTrainedModel

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_sam import TF_SAM_PRETRAINED_MODEL_ARCHIVE_LIST, TFSamModel, TFSamPreTrainedModel

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .image_processing_sam import SamImageProcessor

else:
					import sys

					lowerCamelCase_					:			Optional[Any]     						=				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
