


'''simple docstring'''

from collections import OrderedDict
from typing import Any, Mapping, Optional

from ... import PreTrainedTokenizer, TensorType, is_torch_available
from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfigWithPast
from ...utils import logging


lowerCamelCase							:   List[str]  						=	logging.get_logger(__name__)

lowerCamelCase							:   str  						=	{
    'EleutherAI/gpt-neo-1.3B': 'https://huggingface.co/EleutherAI/gpt-neo-1.3B/resolve/main/config.json',
    # See all GPTNeo models at https://huggingface.co/models?filter=gpt_neo
}
class   __lowerCAmelCase						(__snake_case     ):





      '''simple docstring'''






      lowerCAmelCase__					:     List[Any]  					=							"""gpt_neo"""
      lowerCAmelCase__					:     Dict  					=							["""past_key_values"""]
      lowerCAmelCase__					:     Optional[int]  					=							{"""num_attention_heads""": """num_heads""", """num_hidden_layers""": """num_layers"""}



      def __init__(self    :    int   ,						UpperCamelCase    :    List[str]=50257   ,						UpperCamelCase    :    List[Any]=2048   ,						UpperCamelCase    :    Dict=2048   ,						UpperCamelCase    :    Optional[Any]=24   ,						UpperCamelCase    :    Dict=[[["global", "local"], 12]]   ,						UpperCamelCase    :    Any=16   ,						UpperCamelCase    :    Any=None   ,						UpperCamelCase    :    Tuple=256   ,						UpperCamelCase    :    Optional[Any]="gelu_new"   ,						UpperCamelCase    :    Union[str, Any]=0.0   ,						UpperCamelCase    :    List[str]=0.0   ,						UpperCamelCase    :    Union[str, Any]=0.0   ,						UpperCamelCase    :    List[Any]=0.1   ,						UpperCamelCase    :    Tuple=1E-5   ,						UpperCamelCase    :    Union[str, Any]=0.02   ,						UpperCamelCase    :    Optional[int]=True   ,						UpperCamelCase    :    List[str]=50256   ,						UpperCamelCase    :    Dict=50256   ,						**UpperCamelCase    :    int   ,						):

             '''simple docstring'''







             lowercase__      			= vocab_size
             lowercase__      			= max_position_embeddings
             lowercase__      			= hidden_size
             lowercase__      			= num_layers
             lowercase__      			= num_heads
             lowercase__      			= intermediate_size
             lowercase__      			= window_size
             lowercase__      			= activation_function
             lowercase__      			= resid_dropout
             lowercase__      			= embed_dropout
             lowercase__      			= attention_dropout
             lowercase__      			= classifier_dropout
             lowercase__      			= layer_norm_epsilon
             lowercase__      			= initializer_range
             lowercase__      			= use_cache

             lowercase__      			= bos_token_id
             lowercase__      			= eos_token_id

             lowercase__      			= attention_types
             lowercase__      			= self.expand_attention_types_params(UpperCamelCase )

             if len(self.attention_layers ) != self.num_layers:
                    raise ValueError(
                        '''Configuration for convolutional module is incorrect. '''
                        '''It is required that `len(config.attention_layers)` == `config.num_layers` '''
                        f"but is `len(config.attention_layers) = {len(self.attention_layers )}`, "
                        f"`config.num_layers = {self.num_layers}`. "
                        '''`config.attention_layers` is prepared using `config.attention_types`. '''
                        '''Please verify the value of `config.attention_types` argument.''' )

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






      @staticmethod
      def       UpperCamelCase__		(UpperCamelCase    :    Dict ):

             '''simple docstring'''







             lowercase__      			= []
             for item in attention_types:
                    for _ in range(item[1] ):
                           attentions.extend(item[0] )
             return attentions






def _SCREAMING_SNAKE_CASE      (A  , A  , A  , A       )       ->       List[str]:






       """simple docstring"""







       import torch

       lowercase__      			= input.size()
       lowercase__      			= len(snake_case__       )
       lowercase__      			= shape[dimension]

       lowercase__      			= torch.arange(0  , snake_case__  , snake_case__       )
       lowercase__      			= torch.div(sizedim - size  , snake_case__  , rounding_mode='''floor'''       ) + 1
       lowercase__      			= torch.arange(snake_case__       ) + low_indices[:min_length][:, None]

       lowercase__      			= [slice(snake_case__       )] * rank
       lowercase__      			= indices
       lowercase__      			= input[s]

       lowercase__      			= list(range(0  , rank + 1       )       )
       perm.append(perm.pop(dimension + 1       )       )

       return sliced.permute(snake_case__       )

def _SCREAMING_SNAKE_CASE      (A  , A       )       ->       List[str]:






       """simple docstring"""







       import torch

       lowercase__      			= torch.arange(1  , snake_case__       )
       lowercase__      			= torch.remainder(snake_case__  , snake_case__       )
       lowercase__      			= remainders == 0
       lowercase__      			= candidates[divisor_indices]
       lowercase__      			= torch.max(snake_case__       )
       return largest_divisor, torch.div(snake_case__  , snake_case__  , rounding_mode='''floor'''       )

class   __lowerCAmelCase						(__snake_case     ):





      '''simple docstring'''






      @property
      def       UpperCamelCase__		(self    :    Optional[Any] ):

             '''simple docstring'''







             lowercase__      			= OrderedDict({'''input_ids''': {0: '''batch''', 1: '''sequence'''}} )
             if self.use_past:
                    self.fill_with_past_key_values_(UpperCamelCase   ,						direction='''inputs''' )
                    lowercase__      			= {0: '''batch''', 1: '''past_sequence + sequence'''}
             else:
                    lowercase__      			= {0: '''batch''', 1: '''sequence'''}

             return common_inputs



      @property
      def       UpperCamelCase__		(self    :    List[Any] ):

             '''simple docstring'''







             return self._config.num_heads



      def       UpperCamelCase__		(self    :    List[Any]   ,						UpperCamelCase    :    List[Any]   ,						UpperCamelCase    :    str = -1   ,						UpperCamelCase    :    Tuple = -1   ,						UpperCamelCase    :    Tuple = False   ,						UpperCamelCase    :    Optional[Any] = None   ,						):

             '''simple docstring'''







             lowercase__      			= super(UpperCamelCase   ,						self ).generate_dummy_inputs(
                 UpperCamelCase   ,						batch_size=UpperCamelCase   ,						seq_length=UpperCamelCase   ,						is_pair=UpperCamelCase   ,						framework=UpperCamelCase )

             # We need to order the input in the way they appears in the forward()
             lowercase__      			= 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

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

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

             return ordered_inputs






      @property
      def       UpperCamelCase__		(self    :    Dict ):

             '''simple docstring'''







             return 13






'''simple docstring'''




import os







def 		lowerCAmelCase_				(   ):




    '''simple docstring'''



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


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




