

'''simple docstring'''



from ..models.auto import AutoModelForSeqaSeqLM, AutoTokenizer
from .base import PipelineTool


UpperCAmelCase				: List[Any]         =  'Here is a text containing a lot of information: \'\'\'{text}\'\'\'.\n\nCan you answer this question about the text: \'{question}\''







class 		lowerCAmelCase__     (   a      ):



 """simple docstring"""



 lowerCAmelCase__						      =   "google/flan-t5-base"
 lowerCAmelCase__						      =   (
     "This is a tool that answers questions related to a text. It takes two arguments named `text`, which is the "
     "text where to find the answer, and `question`, which is the question, and returns the answer to the question."
 )
 lowerCAmelCase__						      =   "text_qa"
 lowerCAmelCase__						      =   AutoTokenizer
 lowerCAmelCase__						      =   AutoModelForSeqaSeqLM

 lowerCAmelCase__						      =   ["text", "text"]
 lowerCAmelCase__						      =   ["text"]
 def    UpperCAmelCase__	(	self      : str      ,							__SCREAMING_SNAKE_CASE      : str      ,							__SCREAMING_SNAKE_CASE      : str    )						->				Tuple:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE						     =   QA_PROMPT.format(text=__SCREAMING_SNAKE_CASE      ,							question=__SCREAMING_SNAKE_CASE    )
      return self.pre_processor(__SCREAMING_SNAKE_CASE      ,							return_tensors="""pt"""    )
 def    UpperCAmelCase__	(	self      : Any      ,							__SCREAMING_SNAKE_CASE      : int    )						->				Union[str, Any]:


      """simple docstring"""




      __SCREAMING_SNAKE_CASE						     =   self.model.generate(**__SCREAMING_SNAKE_CASE    )

      __SCREAMING_SNAKE_CASE     ,    __SCREAMING_SNAKE_CASE						     =   inputs["""input_ids"""].shape
      __SCREAMING_SNAKE_CASE						     =   output_ids.shape[0]

      return output_ids.reshape(__SCREAMING_SNAKE_CASE      ,							out_b // in_b      ,							*output_ids.shape[1:]    )[0][0]


 def    UpperCAmelCase__	(	self      : Any      ,							__SCREAMING_SNAKE_CASE      : List[Any]    )						->				Any:


      """simple docstring"""




      return self.pre_processor.decode(__SCREAMING_SNAKE_CASE      ,							skip_special_tokens=__SCREAMING_SNAKE_CASE      ,							clean_up_tokenization_spaces=__SCREAMING_SNAKE_CASE    )









'''simple docstring'''



def      a__ (						):




     """simple docstring"""


     __SCREAMING_SNAKE_CASE						     =   1

     while True:
          if (
              sorted(str(a__		)		)
              == sorted(str(2 * i		)		)
              == sorted(str(3 * i		)		)
              == sorted(str(4 * i		)		)
              == sorted(str(5 * i		)		)
              == sorted(str(6 * i		)		)
          ):
               return i

          i += 1


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






