


'''simple docstring'''

import numpy as np

from transformers import Pipeline





def __snake_case					(      UpperCAmelCase_						:						Dict		):
 lowerCamelCase_      =  np.max(UpperCAmelCase_					,				axis=-1					,				keepdims=UpperCAmelCase_		)
 lowerCamelCase_      =  np.exp(outputs - maxes		)
 return shifted_exp / shifted_exp.sum(axis=-1					,				keepdims=UpperCAmelCase_		)







class      snake_case    (    lowercase			):





  """simple docstring"""




  def   snake_case		(    self			,  **UpperCamelCase     ):







   """simple docstring"""
   lowerCamelCase_      =  {}
   if "second_text" in kwargs:
    lowerCamelCase_      =  kwargs["second_text"]
   return preprocess_kwargs, {}, {}






  def   snake_case		(    self			,  UpperCamelCase			,  UpperCamelCase=None     ):







   """simple docstring"""
   return self.tokenizer(UpperCamelCase			,  text_pair=UpperCamelCase			,  return_tensors=self.framework     )






  def   snake_case		(    self			,  UpperCamelCase     ):







   """simple docstring"""
   return self.model(**UpperCamelCase     )







  def   snake_case		(    self			,  UpperCamelCase     ):







   """simple docstring"""
   lowerCamelCase_      =  model_outputs.logits[0].numpy()
   lowerCamelCase_      =  softmax(UpperCamelCase     )

   lowerCamelCase_      =  np.argmax(UpperCamelCase     )
   lowerCamelCase_      =  self.model.config.idalabel[best_class]
   lowerCamelCase_      =  probabilities[best_class].item()
   lowerCamelCase_      =  logits.tolist()
   return {"label": label, "score": score, "logits": logits}







'''simple docstring'''

a_  :				str						= """
# Transformers installation
! pip install transformers datasets
# To install from source instead of the last release, comment the command above and uncomment the following one.
# ! pip install git+https://github.com/huggingface/transformers.git
"""

a_  :				Any						= [{"""type""": """code""", """content""": INSTALL_CONTENT}]
a_  :				int						= {
    """{processor_class}""": """FakeProcessorClass""",
    """{model_class}""": """FakeModelClass""",
    """{object_class}""": """FakeObjectClass""",
}



