






from typing import Mapping

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


lowerCamelCase__       		=  logging.get_logger(__name__)

lowerCamelCase__       		=  {
    """google/umt5-small""": """https://huggingface.co/google/umt5-small/resolve/main/config.json""",
    # See all umt5 models at https://huggingface.co/models?filter=umt5
}




class       snake_case__ (				lowercase_):

       '''simple docstring'''
       lowerCamelCase				:					List[str]								=			"umt5"
       lowerCamelCase				:					Optional[Any]								=			["past_key_values"]



       def __init__(				self      ,    a__=25_01_12      ,    a__=5_12      ,    a__=64      ,    a__=10_24      ,    a__=8      ,    a__=None      ,    a__=6      ,    a__=32      ,    a__=1_28      ,    a__=0.1      ,    a__=1e-6      ,    a__=1.0      ,    a__="gated-gelu"      ,    a__=True      ,    a__=True      ,    a__="T5Tokenizer"      ,    a__=True      ,    a__=0      ,    a__=1      ,    a__=0      ,    **a__      ,    )			->   int:






            '''simple docstring'''





            super().__init__(
                is_encoder_decoder=a__      ,    tokenizer_class=a__      ,    tie_word_embeddings=a__      ,    pad_token_id=a__      ,    eos_token_id=a__      ,    decoder_start_token_id=a__      ,    **a__      ,    )
            __snake_case      :List[Any] 							=    vocab_size
            __snake_case      :str 							=    d_model
            __snake_case      :str 							=    d_kv
            __snake_case      :Any 							=    d_ff
            __snake_case      :Union[str, Any] 							=    num_layers
            __snake_case      :Dict 							=    (
                num_decoder_layers if num_decoder_layers is not None else self.num_layers
            )  # default = symmetry
            __snake_case      :Tuple 							=    num_heads
            __snake_case      :str 							=    relative_attention_num_buckets
            __snake_case      :Union[str, Any] 							=    relative_attention_max_distance
            __snake_case      :Any 							=    dropout_rate
            __snake_case      :str 							=    layer_norm_epsilon
            __snake_case      :List[str] 							=    initializer_factor
            __snake_case      :List[Any] 							=    feed_forward_proj
            __snake_case      :List[Any] 							=    use_cache

            __snake_case      :Union[str, Any] 							=    self.feed_forward_proj.split("""-"""     )
            __snake_case      :List[str] 							=    act_info[-1]
            __snake_case      :Tuple 							=    act_info[0] == """gated"""

            if len(a__     ) > 1 and act_info[0] != "gated" or len(a__     ) > 2:
                 raise ValueError(
                     F'''`feed_forward_proj`: {feed_forward_proj} is not a valid activation function of the dense layer.'''
                     """Please make sure `feed_forward_proj` is of the format `gated-{ACT_FN}` or `{ACT_FN}`, e.g. """
                     """'gated-gelu' or 'relu'"""     )

            if feed_forward_proj == "gated-gelu":
                 __snake_case      :str 							=    """gelu_new"""



       @property
       def        __lowercase    (				self     )			->   Union[str, Any]:






            '''simple docstring'''





            return self.d_model



       @property
       def        __lowercase    (				self     )			->   Tuple:






            '''simple docstring'''





            return self.num_heads



       @property
       def        __lowercase    (				self     )			->   Optional[int]:






            '''simple docstring'''





            return self.num_layers




class       snake_case__ (				lowercase_):

       '''simple docstring'''



       @property
       # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.inputs
       def        __lowercase    (				self     )			->   Mapping[str, Mapping[int, str]]:






            '''simple docstring'''





            __snake_case      :List[str] 							=    {
                """input_ids""": {0: """batch""", 1: """encoder_sequence"""},
                """attention_mask""": {0: """batch""", 1: """encoder_sequence"""},
            }
            if self.use_past:
                 __snake_case      :Tuple 							=    """past_encoder_sequence + sequence"""
                 __snake_case      :Optional[int] 							=    {0: """batch"""}
                 __snake_case      :str 							=    {0: """batch""", 1: """past_decoder_sequence + sequence"""}
            else:
                 __snake_case      :Union[str, Any] 							=    {0: """batch""", 1: """decoder_sequence"""}
                 __snake_case      :int 							=    {0: """batch""", 1: """decoder_sequence"""}

            if self.use_past:
                 self.fill_with_past_key_values_(a__      ,    direction="""inputs"""     )

            return common_inputs



       @property
       # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.default_onnx_opset
       def        __lowercase    (				self     )			->   int:






            '''simple docstring'''





            return 13



       @property
       def        __lowercase    (				self     )			->   float:






            '''simple docstring'''





            return 5e-4










from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


lowerCamelCase__       		=  logging.get_logger(__name__)

lowerCamelCase__       		=  {
    """microsoft/focalnet-tiny""": """https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json""",
}




class       snake_case__ (				lowercase_						,     lowercase_):

       '''simple docstring'''
       lowerCamelCase				:					List[Any]								=			"focalnet"



       def __init__(				self      ,    a__=2_24      ,    a__=4      ,    a__=3      ,    a__=96      ,    a__=False      ,    a__=[1_92, 3_84, 7_68, 7_68]      ,    a__=[2, 2, 6, 2]      ,    a__=[2, 2, 2, 2]      ,    a__=[3, 3, 3, 3]      ,    a__="gelu"      ,    a__=4.0      ,    a__=0.0      ,    a__=0.1      ,    a__=False      ,    a__=1e-4      ,    a__=False      ,    a__=False      ,    a__=False      ,    a__=0.02      ,    a__=1e-5      ,    a__=32      ,    a__=None      ,    a__=None      ,    **a__      ,    )			->   Tuple:






            '''simple docstring'''





            super().__init__(**a__     )

            __snake_case      :Optional[Any] 							=    image_size
            __snake_case      :Dict 							=    patch_size
            __snake_case      :Tuple 							=    num_channels
            __snake_case      :List[str] 							=    embed_dim
            __snake_case      :Any 							=    use_conv_embed
            __snake_case      :List[Any] 							=    hidden_sizes
            __snake_case      :str 							=    depths
            __snake_case      :List[Any] 							=    focal_levels
            __snake_case      :int 							=    focal_windows
            __snake_case      :Any 							=    hidden_act
            __snake_case      :List[str] 							=    mlp_ratio
            __snake_case      :str 							=    hidden_dropout_prob
            __snake_case      :List[str] 							=    drop_path_rate
            __snake_case      :int 							=    use_layerscale
            __snake_case      :int 							=    layerscale_value
            __snake_case      :Tuple 							=    use_post_layernorm
            __snake_case      :Dict 							=    use_post_layernorm_in_modulation
            __snake_case      :Union[str, Any] 							=    normalize_modulator
            __snake_case      :List[str] 							=    initializer_range
            __snake_case      :Optional[Any] 							=    layer_norm_eps
            __snake_case      :Tuple 							=    encoder_stride
            __snake_case      :List[str] 							=    ["""stem"""] + [F'''stage{idx}''' for idx in range(1      ,    len(self.depths     ) + 1     )]
            __snake_case							,			__snake_case      :str 							=    get_aligned_output_features_output_indices(
                out_features=a__      ,    out_indices=a__      ,    stage_names=self.stage_names     )


