"""simple docstring"""




from typing import TYPE_CHECKING

import torch

from ..models.auto import AutoModelForVisualQuestionAnswering, AutoProcessor
from ..utils import requires_backends
from .base import PipelineTool


if TYPE_CHECKING:
     from PIL import Image
class 		__A							(				__A	):
     _UpperCamelCase	      =	"dandelin/vilt-b32-finetuned-vqa"
     _UpperCamelCase	      =	(
         "This is a tool that answers a question about an image. It takes an input named `image` which should be the "
         "image containing the information, as well as a `question` which should be the question in English. It "
         "returns a text that is the answer to the question."
     )
     _UpperCamelCase	      =	"image_qa"
     _UpperCamelCase	      =	AutoProcessor
     _UpperCamelCase	      =	AutoModelForVisualQuestionAnswering

     _UpperCamelCase	      =	["image", "text"]
     _UpperCamelCase	      =	["text"]






     def __init__(	self       ,  *a__       ,  **a__						):
       requires_backends(self       ,  ["""vision"""]						)
       super().__init__(*a__       ,  **a__						)






     def 					__A						(	self       ,  a__       ,  a__						):
       return self.pre_processor(a__       ,  a__       ,  return_tensors="""pt"""						)






     def 					__A						(	self       ,  a__						):

       with torch.no_grad():
         return self.model(**a__						).logits






     def 					__A						(	self       ,  a__						):
       _lowerCAmelCase		: str						    =  outputs.argmax(-1						).item()
       return self.model.config.idalabel[idx]





"""simple docstring"""




def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: int			) ->   bool:
  return sum(i for i in range(1    ,number // 2 + 1			) if number % i == 0			) == number


if __name__ == "__main__":
     print('Program to check whether a number is a Perfect number or not...')
     _a   :	int 					=     int(input('Enter number: ').strip())
     print(F"""{number} is {"" if perfect(number) else "not "}a Perfect Number.""")




