


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


_A		       =						logging.get_logger(__name__)

_A		       =						{
    'microsoft/swinv2-tiny-patch4-window8-256': (
        'https://huggingface.co/microsoft/swinv2-tiny-patch4-window8-256/resolve/main/config.json'
    ),
}






class     UpperCAmelCase__       (					A_		):



    """simple docstring"""






    UpperCAmelCase__						:		str      =  "swinv2"

    UpperCAmelCase__						:		Dict      =  {
        "num_attention_heads": "num_heads",
        "num_hidden_layers": "num_layers",
    }






    def __init__(			self					,   A_=224					,   A_=4					,   A_=3					,   A_=96					,   A_=[2, 2, 6, 2]					,   A_=[3, 6, 12, 24]					,   A_=7					,   A_=4.0					,   A_=True					,   A_=0.0					,   A_=0.0					,   A_=0.1					,   A_="gelu"					,   A_=False					,   A_=0.02					,   A_=1E-5					,   A_=32					,   **A_					,   )  ->       Any:
         super().__init__(**A_    )

         __UpperCamelCase    							=image_size
         __UpperCamelCase    							=patch_size
         __UpperCamelCase    							=num_channels
         __UpperCamelCase    							=embed_dim
         __UpperCamelCase    							=depths
         __UpperCamelCase    							=len(A_    )
         __UpperCamelCase    							=num_heads
         __UpperCamelCase    							=window_size
         __UpperCamelCase    							=mlp_ratio
         __UpperCamelCase    							=qkv_bias
         __UpperCamelCase    							=hidden_dropout_prob
         __UpperCamelCase    							=attention_probs_dropout_prob
         __UpperCamelCase    							=drop_path_rate
         __UpperCamelCase    							=hidden_act
         __UpperCamelCase    							=use_absolute_embeddings
         __UpperCamelCase    							=layer_norm_eps
         __UpperCamelCase    							=initializer_range
         __UpperCamelCase    							=encoder_stride
         # we set the hidden_size attribute in order to make Swinv2 work with VisionEncoderDecoderModel
         # this indicates the channel dimension after the last stage of the model
         __UpperCamelCase    							=int(embed_dim * 2 ** (len(A_    ) - 1)    )
         __UpperCamelCase    							=(0, 0, 0, 0)









import warnings

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


_A		       =						logging.get_logger(__name__)

_A		       =						{
    'RUCAIBox/mvp': 'https://huggingface.co/RUCAIBox/mvp/resolve/main/config.json',
}






class     UpperCAmelCase__       (					A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Optional[int]      =  "mvp"
    UpperCAmelCase__						:		Tuple      =  ["past_key_values"]
    UpperCAmelCase__						:		Union[str, Any]      =  {"num_attention_heads": "encoder_attention_heads", "hidden_size": "d_model"}






    def __init__(			self					,   A_=50267					,   A_=1024					,   A_=12					,   A_=4096					,   A_=16					,   A_=12					,   A_=4096					,   A_=16					,   A_=0.0					,   A_=0.0					,   A_="gelu"					,   A_=1024					,   A_=0.1					,   A_=0.0					,   A_=0.0					,   A_=0.02					,   A_=0.0					,   A_=False					,   A_=True					,   A_=1					,   A_=0					,   A_=2					,   A_=True					,   A_=2					,   A_=2					,   A_=False					,   A_=100					,   A_=800					,   **A_					,   )  ->       Union[str, Any]:
         __UpperCamelCase    							=vocab_size
         __UpperCamelCase    							=max_position_embeddings
         __UpperCamelCase    							=d_model
         __UpperCamelCase    							=encoder_ffn_dim
         __UpperCamelCase    							=encoder_layers
         __UpperCamelCase    							=encoder_attention_heads
         __UpperCamelCase    							=decoder_ffn_dim
         __UpperCamelCase    							=decoder_layers
         __UpperCamelCase    							=decoder_attention_heads
         __UpperCamelCase    							=dropout
         __UpperCamelCase    							=attention_dropout
         __UpperCamelCase    							=activation_dropout
         __UpperCamelCase    							=activation_function
         __UpperCamelCase    							=init_std
         __UpperCamelCase    							=encoder_layerdrop
         __UpperCamelCase    							=decoder_layerdrop
         __UpperCamelCase    							=classifier_dropout
         __UpperCamelCase    							=use_cache
         __UpperCamelCase    							=encoder_layers
         __UpperCamelCase    							=scale_embedding  # scale factor will be sqrt(d_model) if True
         __UpperCamelCase    							=use_prompt
         __UpperCamelCase    							=prompt_length
         __UpperCamelCase    							=prompt_mid_dim

         super().__init__(
             pad_token_id=A_					,   bos_token_id=A_					,   eos_token_id=A_					,   is_encoder_decoder=A_					,   decoder_start_token_id=A_					,   forced_eos_token_id=A_					,   **A_					,   )

         if self.forced_bos_token_id is None and kwargs.get('force_bos_token_to_be_generated'					,   A_    ):
              __UpperCamelCase    							=self.bos_token_id
              warnings.warn(
                  f'Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions. '
                  'The config can simply be saved and uploaded again to be fixed.'    )





