


"""simple docstring"""







from typing import Mapping

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


__lowercase    					=      logging.get_logger(__name__)

__lowercase    					=      {
    """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 						_A  (  _a  ):







    """simple docstring"""




    UpperCAmelCase       :							str	=       """umt5"""
    UpperCAmelCase       :							Optional[Any]	=       ["""past_key_values"""]






    def __init__(					self				:    Optional[Any]				, __UpperCAmelCase				:    int=250112				, __UpperCAmelCase				:    List[str]=512				, __UpperCAmelCase				:    Optional[int]=64				, __UpperCAmelCase				:    str=1024				, __UpperCAmelCase				:    Union[str, Any]=8				, __UpperCAmelCase				:    str=None				, __UpperCAmelCase				:    List[str]=6				, __UpperCAmelCase				:    str=32				, __UpperCAmelCase				:    List[Any]=128				, __UpperCAmelCase				:    int=0.1				, __UpperCAmelCase				:    str=1e-6				, __UpperCAmelCase				:    List[Any]=1.0				, __UpperCAmelCase				:    Dict="gated-gelu"				, __UpperCAmelCase				:    Optional[Any]=True				, __UpperCAmelCase				:    int=True				, __UpperCAmelCase				:    Any="T5Tokenizer"				, __UpperCAmelCase				:    Tuple=True				, __UpperCAmelCase				:    str=0				, __UpperCAmelCase				:    List[Any]=1				, __UpperCAmelCase				:    str=0				, **__UpperCAmelCase				:    Optional[Any]				, ):
      super().__init__(
          is_encoder_decoder=__UpperCAmelCase				, tokenizer_class=__UpperCAmelCase				, tie_word_embeddings=__UpperCAmelCase				, pad_token_id=__UpperCAmelCase				, eos_token_id=__UpperCAmelCase				, decoder_start_token_id=__UpperCAmelCase				, **__UpperCAmelCase				, )
      a						:		List[str]      							=			vocab_size
      a						:		int      							=			d_model
      a						:		Any      							=			d_kv
      a						:		List[Any]      							=			d_ff
      a						:		Dict      							=			num_layers
      a						:		Dict      							=			(
          num_decoder_layers if num_decoder_layers is not None else self.num_layers
      )  # default = symmetry
      a						:		Tuple      							=			num_heads
      a						:		Tuple      							=			relative_attention_num_buckets
      a						:		Optional[int]      							=			relative_attention_max_distance
      a						:		List[str]      							=			dropout_rate
      a						:		int      							=			layer_norm_epsilon
      a						:		Optional[Any]      							=			initializer_factor
      a						:		Any      							=			feed_forward_proj
      a						:		int      							=			use_cache

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

      if len(__UpperCAmelCase) > 1 and act_info[0] != "gated" or len(__UpperCAmelCase) > 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":
        a						:		Tuple      							=			"gelu_new"






    @property
    def 	__snake_case							(					self				:    Optional[int]):
      return self.d_model






    @property
    def 	__snake_case							(					self				:    Tuple):
      return self.num_heads






    @property
    def 	__snake_case							(					self				:    Union[str, Any]):
      return self.num_layers






class 						_A  (  _a  ):







    """simple docstring"""




    @property
    # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.inputs
    def 	__snake_case							(					self				:    Optional[Any]):
      a						:		Tuple      							=			{
          "input_ids": {0: "batch", 1: "encoder_sequence"},
          "attention_mask": {0: "batch", 1: "encoder_sequence"},
      }
      if self.use_past:
        a						:		Optional[Any]      							=			"past_encoder_sequence + sequence"
        a						:		List[Any]      							=			{0: "batch"}
        a						:		List[Any]      							=			{0: "batch", 1: "past_decoder_sequence + sequence"}
      else:
        a						:		int      							=			{0: "batch", 1: "decoder_sequence"}
        a						:		List[Any]      							=			{0: "batch", 1: "decoder_sequence"}

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

      return common_inputs






    @property
    # Copied from transformers.models.t5.configuration_t5.T5OnnxConfig.default_onnx_opset
    def 	__snake_case							(					self				:    Tuple):
      return 13






    @property
    def 	__snake_case							(					self				:    Union[str, Any]):
      return 5e-4












from __future__ import annotations


def 						lowerCamelCase__    (		_A							):







	'''simple docstring'''





	snake_case_		    =     str(_A							)
	return len(_A							) == 9 and set(_A							) == set("123456789"							)


def 						lowerCamelCase__    (		):







	'''simple docstring'''





	for base_num in range(9999     ,	4999     ,	-1							):
		snake_case_		    =     100002 * base_num
		if is_9_pandigital(_A							):
			return candidate

	for base_num in range(333     ,	99     ,	-1							):
		snake_case_		    =     1002003 * base_num
		if is_9_pandigital(_A							):
			return candidate

	return None


if __name__ == "__main__":
		print(f'''{solution() = }''')
