





'''simple docstring'''




from typing import TYPE_CHECKING

from ..models.auto import AutoModelForVisionaSeq
from ..utils import requires_backends
from .base import PipelineTool


if TYPE_CHECKING:
  from PIL import Image







class   A_	(  __snake_case			):
 _lowerCamelCase  : Dict           =							"""Salesforce/blip-image-captioning-base"""
 _lowerCamelCase  : int           =							(
     """This is a tool that generates a description of an image. It takes an input named `image` which should be the """
     """image to caption, and returns a text that contains the description in English."""
 )
 _lowerCamelCase  : Optional[int]           =							"""image_captioner"""
 _lowerCamelCase  : Optional[Any]           =							AutoModelForVisionaSeq

 _lowerCamelCase  : int           =							["""image"""]
 _lowerCamelCase  : Optional[Any]           =							["""text"""]




 def __init__(					self       :    Optional[Any]	,			*snake_case_       :    Optional[Any]	,			**snake_case_       :    List[Any]    ):
      requires_backends(self	,			["vision"]    )
      super().__init__(*__SCREAMING_SNAKE_CASE	,			**__SCREAMING_SNAKE_CASE    )




 def      lowercase	(					self       :    List[Any]	,			snake_case_       :    "Image"    ):
      return self.pre_processor(images=__SCREAMING_SNAKE_CASE	,			return_tensors="pt"    )




 def      lowercase	(					self       :    List[str]	,			snake_case_       :    Tuple    ):
      return self.model.generate(**__SCREAMING_SNAKE_CASE    )




 def      lowercase	(					self       :    Union[str, Any]	,			snake_case_       :    List[str]    ):
      return self.pre_processor.batch_decode(__SCREAMING_SNAKE_CASE	,			skip_special_tokens=__SCREAMING_SNAKE_CASE    )[0].strip()












"""simple docstring"""





import os







def      lowerCamelCase__       (							)      ->				List[Any]:
  with open(os.path.dirname(_lowerCamelCase ) + '/grid.txt' ) as f:
    lowerCamelCase_         =						[]  # noqa: E741
    for _ in range(20 ):
      l.append([int(_lowerCamelCase ) for x in f.readline().split()] )

    lowerCamelCase_         =						0

    # right
    for i in range(20 ):
      for j in range(17 ):
        lowerCamelCase_         =						l[i][j] * l[i][j + 1] * l[i][j + 2] * l[i][j + 3]
        if temp > maximum:
          lowerCamelCase_         =						temp

        # down
    for i in range(17 ):
      for j in range(20 ):
        lowerCamelCase_         =						l[i][j] * l[i + 1][j] * l[i + 2][j] * l[i + 3][j]
        if temp > maximum:
          lowerCamelCase_         =						temp

        # diagonal 1
    for i in range(17 ):
      for j in range(17 ):
        lowerCamelCase_         =						l[i][j] * l[i + 1][j + 1] * l[i + 2][j + 2] * l[i + 3][j + 3]
        if temp > maximum:
          lowerCamelCase_         =						temp

        # diagonal 2
    for i in range(17 ):
      for j in range(3		,				20 ):
        lowerCamelCase_         =						l[i][j] * l[i + 1][j - 1] * l[i + 2][j - 2] * l[i + 3][j - 3]
        if temp > maximum:
          lowerCamelCase_         =						temp
    return maximum


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




