


'''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


lowerCamelCase__    	=     logging.get_logger(__name__)

lowerCamelCase__    	=     {
    '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__			(			UpperCAmelCase__	):
			lowerCAmelCase :	Any          =     "bloom"
			lowerCAmelCase :	Any          =     ["past_key_values"]
			lowerCAmelCase :	Union[str, Any]          =     {
			    "num_hidden_layers": "n_layer",
			    "num_attention_heads": "n_head",
			}




			def __init__(		self  :     Any	,  lowerCamelCase__  :     List[Any]=25_08_80	,  lowerCamelCase__  :     List[str]=64	,  lowerCamelCase__  :     List[str]=2	,  lowerCamelCase__  :     List[Any]=8	,  lowerCamelCase__  :     Any=1E-5	,  lowerCamelCase__  :     str=0.0_2	,  lowerCamelCase__  :     List[Any]=True	,  lowerCamelCase__  :     str=1	,  lowerCamelCase__  :     Tuple=2	,  lowerCamelCase__  :     Any=False	,  lowerCamelCase__  :     Union[str, Any]=0.0	,  lowerCamelCase__  :     Optional[Any]=0.0	,  lowerCamelCase__  :     Optional[Any]=1	,  lowerCamelCase__  :     List[str]=False	,  **lowerCamelCase__  :     Union[str, Any]	,  )   ->Tuple:



					'''simple docstring'''







					_UpperCAmelCase		:       Dict								=      vocab_size
					# Backward compatibility with n_embed kwarg
					_UpperCAmelCase		:       Optional[Any]								=      kwargs.pop("n_embed"	,  lowerCamelCase__ )
					_UpperCAmelCase		:       int								=      hidden_size if n_embed is None else n_embed
					_UpperCAmelCase		:       Optional[Any]								=      n_layer
					_UpperCAmelCase		:       Dict								=      n_head
					_UpperCAmelCase		:       Union[str, Any]								=      layer_norm_epsilon
					_UpperCAmelCase		:       List[Any]								=      initializer_range
					_UpperCAmelCase		:       Optional[Any]								=      use_cache
					_UpperCAmelCase		:       Dict								=      pretraining_tp
					_UpperCAmelCase		:       int								=      apply_residual_connection_post_layernorm
					_UpperCAmelCase		:       str								=      hidden_dropout
					_UpperCAmelCase		:       List[Any]								=      attention_dropout

					_UpperCAmelCase		:       int								=      bos_token_id
					_UpperCAmelCase		:       List[str]								=      eos_token_id
					_UpperCAmelCase		:       List[str]								=      slow_but_exact

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






class 	lowerCAmelCase__			(			UpperCAmelCase__	):
			lowerCAmelCase :	Optional[Any]          =     version.parse("1.12"	)




			def __init__(		self  :     List[Any]	,  lowerCamelCase__  :     PretrainedConfig	,  lowerCamelCase__  :     str = "default"	,  lowerCamelCase__  :     List[PatchingSpec] = None	,  lowerCamelCase__  :     bool = False	,  )   ->int:



					'''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?
							_UpperCAmelCase		:       Union[str, Any]								=      0




			@property
			def 							lowerCAmelCase__    (		self  :     Optional[int] )   ->Mapping[str, Mapping[int, str]]:



					'''simple docstring'''







					_UpperCAmelCase		:       int								=      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__ )
							_UpperCAmelCase		:       Optional[Any]								=      {0: "batch", 1: "past_sequence + sequence"}
					else:
							_UpperCAmelCase		:       Optional[int]								=      {0: "batch", 1: "sequence"}

					return common_inputs




			@property
			def 							lowerCAmelCase__    (		self  :     Dict )   ->int:



					'''simple docstring'''







					return self._config.n_layer




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



					'''simple docstring'''







					return self._config.n_head




			@property
			def 							lowerCAmelCase__    (		self  :     Any )   ->float:



					'''simple docstring'''







					return 1E-3




			def 							lowerCAmelCase__    (		self  :     Union[str, Any]	,  lowerCamelCase__  :     "PreTrainedTokenizer"	,  lowerCamelCase__  :     int = -1	,  lowerCamelCase__  :     int = -1	,  lowerCamelCase__  :     bool = False	,  lowerCamelCase__  :     Optional["TensorType"] = None	,  )   ->Mapping[str, Any]:



					'''simple docstring'''







					_UpperCAmelCase		:       List[str]								=      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()
					_UpperCAmelCase		:       Optional[int]								=      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

									_UpperCAmelCase					,    _UpperCAmelCase		:       List[str]								=      common_inputs["input_ids"].shape
									# Not using the same length for past_key_values
									_UpperCAmelCase		:       Optional[Any]								=      seqlen + 2
									_UpperCAmelCase		:       int								=      self._config.hidden_size // self.num_attention_heads
									_UpperCAmelCase		:       Optional[int]								=      (
									    batch * self.num_attention_heads,
									    head_dim,
									    past_key_values_length,
									)
									_UpperCAmelCase		:       str								=      (
									    batch * self.num_attention_heads,
									    past_key_values_length,
									    head_dim,
									)
									_UpperCAmelCase		:       Optional[int]								=      [
									    (torch.zeros(lowerCamelCase__ ), torch.zeros(lowerCamelCase__ )) for _ in range(self.num_layers )
									]

					_UpperCAmelCase		:       str								=      common_inputs["attention_mask"]
					if self.use_past:
							_UpperCAmelCase		:       str								=      ordered_inputs["attention_mask"].dtype
							_UpperCAmelCase		:       Optional[Any]								=      torch.cat(
							    [ordered_inputs["attention_mask"], torch.ones(lowerCamelCase__	,  lowerCamelCase__	,  dtype=lowerCamelCase__ )]	,  dim=1 )

					return ordered_inputs






			@property
			def 							lowerCAmelCase__    (		self  :     List[Any] )   ->int:



					'''simple docstring'''







					return 13







'''simple docstring'''


import os






def  __lowerCAmelCase ():
		_UpperCAmelCase		:       List[Any]								=      os.path.join(os.path.dirname(__lowerCAmelCase   )      , "num.txt"   )
		with open(__lowerCAmelCase   ) as file_hand:
				return str(sum(int(__lowerCAmelCase   ) for line in file_hand   )   )[:10]


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



