




import torch

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

class 						__lowerCAmelCase      (      a_					):
							UpperCamelCase__   	=    '''facebook/bart-large-mnli'''
							UpperCamelCase__   	=    (
							    '''This is a tool that classifies an English text using provided labels. It takes two inputs: `text`, which '''
							    '''should be the text to classify, and `labels`, which should be the list of labels to use for classification. '''
							    '''It returns the most likely label in the list of provided `labels` for the input text.'''
							)
							UpperCamelCase__   	=    '''text_classifier'''
							UpperCamelCase__   	=    AutoTokenizer
							UpperCamelCase__   	=    AutoModelForSequenceClassification

							UpperCamelCase__   	=    ['''text''', ['''text''']]
							UpperCamelCase__   	=    ['''text''']
							def  lowerCamelCase__				(		self		:int							):







								'''simple docstring'''







								super().setup()
								a									=				self.model.config
								a									=				-1
								for idx, label in config.idalabel.items():
									if label.lower().startswith("""entail"""							):
										a									=				int(UpperCamelCase_							)
								if self.entailment_id == -1:
									raise ValueError("""Could not determine the entailment ID from the model config, please pass it at init."""							)
							def  lowerCamelCase__				(		self		:Dict						, __magic_name__		:Tuple						, __magic_name__		:Any							):







								'''simple docstring'''







								a									=				labels
								return self.pre_processor(
								    [text] * len(UpperCamelCase_							)						, [F'This example is {label}' for label in labels]						, return_tensors="""pt"""						, padding="""max_length"""						, )





							def  lowerCamelCase__				(		self		:Any						, __magic_name__		:Dict							):







								'''simple docstring'''







								a									=				outputs.logits
								a									=				torch.argmax(logits[:, 2]							).item()
								return self._labels[label_id]









"""simple docstring"""
from maths.prime_check import is_prime


def 							A						(				__snake_case: int  )    ->		int:

       """simple docstring"""





       if not isinstance(__snake_case ,     __snake_case  ):
              __magic_name__      				=    F"""Input value of [number={number}] must be an integer"""
              raise TypeError(__snake_case  )
       if is_prime(__snake_case  ) and is_prime(number + 2  ):
              return number + 2
       else:
              return -1


if __name__ == "__main__":
 import doctest

 doctest.testmod()