'''simple docstring'''

from ...configuration_utils import PretrainedConfig
from ...utils import logging


A_     :						Union[str, Any]    							=logging.get_logger(__name__)

A_     :						Dict    							={
    '''s-JoL/Open-Llama-V1''': '''https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json''',
}


class     __UpperCAmelCase       ( __a		):
  __A :				List[Any]											= 'open-llama'





  def __init__(	self    ,     _lowerCamelCase=10_0000    ,     _lowerCamelCase=4096    ,     _lowerCamelCase=1_1008    ,     _lowerCamelCase=32    ,     _lowerCamelCase=32    ,     _lowerCamelCase="silu"    ,     _lowerCamelCase=2048    ,     _lowerCamelCase=0.02    ,     _lowerCamelCase=1E-6    ,     _lowerCamelCase=True    ,     _lowerCamelCase=0    ,     _lowerCamelCase=1    ,     _lowerCamelCase=2    ,     _lowerCamelCase=False    ,     _lowerCamelCase=True    ,     _lowerCamelCase=0.1    ,     _lowerCamelCase=0.1    ,     _lowerCamelCase=True    ,     _lowerCamelCase=True    ,     _lowerCamelCase=None    ,     **_lowerCamelCase    ,     ):
     lowerCAmelCase_			=      vocab_size
     lowerCAmelCase_			=      max_position_embeddings
     lowerCAmelCase_			=      hidden_size
     lowerCAmelCase_			=      intermediate_size
     lowerCAmelCase_			=      num_hidden_layers
     lowerCAmelCase_			=      num_attention_heads
     lowerCAmelCase_			=      hidden_act
     lowerCAmelCase_			=      initializer_range
     lowerCAmelCase_			=      rms_norm_eps
     lowerCAmelCase_			=      use_cache
     lowerCAmelCase_			=      kwargs.pop(
         '''use_memorry_efficient_attention'''    ,     _lowerCamelCase )
     lowerCAmelCase_			=      hidden_dropout_prob
     lowerCAmelCase_			=      attention_dropout_prob
     lowerCAmelCase_			=      use_stable_embedding
     lowerCAmelCase_			=      shared_input_output_embedding
     lowerCAmelCase_			=      rope_scaling
     self._rope_scaling_validation()

     super().__init__(
         pad_token_id=_lowerCamelCase    ,     bos_token_id=_lowerCamelCase    ,     eos_token_id=_lowerCamelCase    ,     tie_word_embeddings=_lowerCamelCase    ,     **_lowerCamelCase    ,     )







  def 						UpperCAmelCase_	(	self ):
     if self.rope_scaling is None:
        return

     if not isinstance(self.rope_scaling    ,     _lowerCamelCase ) or len(self.rope_scaling ) != 2:
        raise ValueError(
            '''`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '''
            F'''got {self.rope_scaling}''' )
     lowerCAmelCase_			=      self.rope_scaling.get('''type'''    ,     _lowerCamelCase )
     lowerCAmelCase_			=      self.rope_scaling.get('''factor'''    ,     _lowerCamelCase )
     if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
        raise ValueError(
            F'''`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}''' )
     if rope_scaling_factor is None or not isinstance(_lowerCamelCase    ,     _lowerCamelCase ) or rope_scaling_factor <= 1.0:
        raise ValueError(F'''`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}''' )






'''simple docstring'''

import os



def snake_case_      (					__snake_case  :							List[Any])			->					str:
   lowerCAmelCase_			=      len(grid[0])
   lowerCAmelCase_			=      len(__snake_case)

   lowerCAmelCase_			=      0
   lowerCAmelCase_			=      0
   lowerCAmelCase_			=      0

   # Check vertically, horizontally, diagonally at the same time (only works
   # for nxn grid)
   for i in range(__snake_case):
      for j in range(n_rows - 3):
         lowerCAmelCase_			=      grid[j][i] * grid[j + 1][i] * grid[j + 2][i] * grid[j + 3][i]
         lowerCAmelCase_			=      grid[i][j] * grid[i][j + 1] * grid[i][j + 2] * grid[i][j + 3]

         # Left-to-right diagonal (\) product
         if i < n_columns - 3:
            lowerCAmelCase_			=      (
                grid[i][j]
                * grid[i + 1][j + 1]
                * grid[i + 2][j + 2]
                * grid[i + 3][j + 3]
            )

         # Right-to-left diagonal(/) product
         if i > 2:
            lowerCAmelCase_			=      (
                grid[i][j]
                * grid[i - 1][j + 1]
                * grid[i - 2][j + 2]
                * grid[i - 3][j + 3]
            )

         lowerCAmelCase_			=      max(
             __snake_case	,   __snake_case	,   __snake_case	,   __snake_case)
         if max_product > largest:
            lowerCAmelCase_			=      max_product

   return largest



def snake_case_      (					)			->					List[Any]:
   lowerCAmelCase_			=      []
   with open(os.path.dirname(__snake_case) + '''/grid.txt''') as file:
      for line in file:
         grid.append(line.strip('''\n''').split(''' '''))

   lowerCAmelCase_			=      [[int(__snake_case) for i in grid[j]] for j in range(len(__snake_case))]

   return largest_product(__snake_case)


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





