"""simple docstring"""
from collections import OrderedDict
from typing import TYPE_CHECKING, Any, List, Mapping, Optional

from packaging import version


if TYPE_CHECKING:
					from ... import PreTrainedTokenizer, TensorType

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast, PatchingSpec
from ...utils import is_torch_available, logging


SCREAMING_SNAKE_CASE__   =					logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__   =					{
    "bigscience/bloom": "https://huggingface.co/bigscience/bloom/resolve/main/config.json",
    "bigscience/bloom-560m": "https://huggingface.co/bigscience/bloom-560m/blob/main/config.json",
    "bigscience/bloom-1b1": "https://huggingface.co/bigscience/bloom-1b1/blob/main/config.json",
    "bigscience/bloom-1b7": "https://huggingface.co/bigscience/bloom-1b7/blob/main/config.json",
    "bigscience/bloom-3b": "https://huggingface.co/bigscience/bloom-3b/blob/main/config.json",
    "bigscience/bloom-7b1": "https://huggingface.co/bigscience/bloom-7b1/blob/main/config.json",
}



class 					lowerCAmelCase_      (     lowerCAmelCase   ):



				"""simple docstring"""
				_lowerCAmelCase       :      Tuple     					=  """bloom"""
				_lowerCAmelCase       :      List[Any]     					=  ["""past_key_values"""]
				_lowerCAmelCase       :      Dict     					=  {
				    """num_hidden_layers""": """n_layer""",
				    """num_attention_heads""": """n_head""",
				}

				def __init__(			self						,      lowerCAmelCase=25_08_80						,      lowerCAmelCase=64						,      lowerCAmelCase=2						,      lowerCAmelCase=8						,      lowerCAmelCase=1E-5						,      lowerCAmelCase=0.02						,      lowerCAmelCase=True						,      lowerCAmelCase=1						,      lowerCAmelCase=2						,      lowerCAmelCase=False						,      lowerCAmelCase=0.0						,      lowerCAmelCase=0.0						,      lowerCAmelCase=1						,      lowerCAmelCase=False						,      **lowerCAmelCase						,      ):






										"""simple docstring"""

										snake_case        =     vocab_size
										# Backward compatibility with n_embed kwarg
										snake_case        =     kwargs.pop('n_embed'						,      lowerCAmelCase      )
										snake_case        =     hidden_size if n_embed is None else n_embed
										snake_case        =     n_layer
										snake_case        =     n_head
										snake_case        =     layer_norm_epsilon
										snake_case        =     initializer_range
										snake_case        =     use_cache
										snake_case        =     pretraining_tp
										snake_case        =     apply_residual_connection_post_layernorm
										snake_case        =     hidden_dropout
										snake_case        =     attention_dropout

										snake_case        =     bos_token_id
										snake_case        =     eos_token_id
										snake_case        =     slow_but_exact

										super().__init__(bos_token_id=lowerCAmelCase						,      eos_token_id=lowerCAmelCase						,      **lowerCAmelCase      )





class 					lowerCAmelCase_      (     lowerCAmelCase   ):



				"""simple docstring"""
				_lowerCAmelCase       :      Optional[int]     					=  version.parse("""1.12"""   )

				def __init__(			self						,      lowerCAmelCase						,      lowerCAmelCase = "default"						,      lowerCAmelCase = None						,      lowerCAmelCase = False						,      ):






										"""simple docstring"""

										super().__init__(lowerCAmelCase						,      task=lowerCAmelCase						,      patching_specs=lowerCAmelCase						,      use_past=lowerCAmelCase      )
										if not getattr(self._config						,      'pad_token_id'						,      lowerCAmelCase      ):
																# TODO: how to do that better?
																snake_case        =     0

				@property
				def 						snake_case	(			self      ):






										"""simple docstring"""

										snake_case        =     OrderedDict({'input_ids': {0: 'batch', 1: 'sequence'}}      )
										if self.use_past:
																# BLOOM stores values on dynamic axis 2. For more details see: https://github.com/huggingface/transformers/pull/18344
																self.fill_with_past_key_values_(lowerCAmelCase						,      direction='inputs'						,      inverted_values_shape=lowerCAmelCase      )
																snake_case        =     {0: 'batch', 1: 'past_sequence + sequence'}
										else:
																snake_case        =     {0: 'batch', 1: 'sequence'}

										return common_inputs

				@property
				def 						snake_case	(			self      ):






										"""simple docstring"""

										return self._config.n_layer

				@property
				def 						snake_case	(			self      ):






										"""simple docstring"""

										return self._config.n_head

				@property
				def 						snake_case	(			self      ):






										"""simple docstring"""

										return 1E-3

				def 						snake_case	(			self						,      lowerCAmelCase						,      lowerCAmelCase = -1						,      lowerCAmelCase = -1						,      lowerCAmelCase = False						,      lowerCAmelCase = None						,      ):






										"""simple docstring"""

										snake_case        =     super(lowerCAmelCase						,      self      ).generate_dummy_inputs(
										    lowerCAmelCase						,      batch_size=lowerCAmelCase						,      seq_length=lowerCAmelCase						,      is_pair=lowerCAmelCase						,      framework=lowerCAmelCase      )

										# We need to order the input in the way they appears in the forward()
										snake_case        =     OrderedDict({'input_ids': common_inputs['input_ids']}      )

										# Need to add the past_keys
										if self.use_past:
																if not is_torch_available():
																						raise ValueError('Cannot generate dummy past_keys inputs without PyTorch installed.'      )
																else:
																						import torch

																						snake_case   ,snake_case        =     common_inputs['input_ids'].shape
																						# Not using the same length for past_key_values
																						snake_case        =     seqlen + 2
																						snake_case        =     self._config.hidden_size // self.num_attention_heads
																						snake_case        =     (
																						    batch * self.num_attention_heads,
																						    head_dim,
																						    past_key_values_length,
																						)
																						snake_case        =     (
																						    batch * self.num_attention_heads,
																						    past_key_values_length,
																						    head_dim,
																						)
																						snake_case        =     [
																						    (torch.zeros(lowerCAmelCase      ), torch.zeros(lowerCAmelCase      )) for _ in range(self.num_layers      )
																						]

										snake_case        =     common_inputs['attention_mask']
										if self.use_past:
																snake_case        =     ordered_inputs['attention_mask'].dtype
																snake_case        =     torch.cat(
																    [ordered_inputs['attention_mask'], torch.ones(lowerCAmelCase						,      lowerCAmelCase						,      dtype=lowerCAmelCase      )]						,      dim=1      )

										return ordered_inputs

				@property
				def 						snake_case	(			self      ):






										"""simple docstring"""

										return 13



"""simple docstring"""
SCREAMING_SNAKE_CASE__   =					{str(digit): digit**5 for digit in range(10)}





def 				lowerCAmelCase__      (     _UpperCamelCase    :			int   )   ->			int:





						"""simple docstring"""






						return sum(DIGITS_FIFTH_POWER[digit] for digit in str(_UpperCamelCase   )   )





def 				lowerCAmelCase__      (     )   ->			int:





						"""simple docstring"""






						return sum(
						    number
						    for number in range(1_0_0_0	,     1_0_0_0_0_0_0   )
						    if number == digits_fifth_powers_sum(_UpperCamelCase   )   )


if __name__ == "__main__":
					print(solution())


