




import numpy as np

from transformers import Pipeline

def      A      (      _SCREAMING_SNAKE_CASE    )	-> Optional[int]:
       lowerCamelCase   :      Dict			 =					np.max(_SCREAMING_SNAKE_CASE ,axis=-1 ,keepdims=_SCREAMING_SNAKE_CASE    )
       lowerCamelCase   :      Dict			 =					np.exp(outputs - maxes    )
       return shifted_exp / shifted_exp.sum(axis=-1 ,keepdims=_SCREAMING_SNAKE_CASE    )




class 		UpperCamelCase__	(lowerCAmelCase__     ):

    '''simple docstring'''



    def     _lowercase     (    self     ,  **UpperCamelCase__     )     ->      Dict:
           lowerCamelCase   :      Optional[Any]			 =					{}
           if "second_text" in kwargs:
                  lowerCamelCase   :      Union[str, Any]			 =					kwargs["second_text"]
           return preprocess_kwargs, {}, {}







    def     _lowercase     (    self     ,  UpperCamelCase__     ,  UpperCamelCase__=None     )     ->      int:
           return self.tokenizer(UpperCamelCase__     ,  text_pair=UpperCamelCase__     ,  return_tensors=self.framework     )







    def     _lowercase     (    self     ,  UpperCamelCase__     )     ->      str:
           return self.model(**UpperCamelCase__     )







    def     _lowercase     (    self     ,  UpperCamelCase__     )     ->      Optional[Any]:
           lowerCamelCase   :      str			 =					model_outputs.logits[0].numpy()
           lowerCamelCase   :      Any			 =					softmax(UpperCamelCase__     )

           lowerCamelCase   :      List[str]			 =					np.argmax(UpperCamelCase__     )
           lowerCamelCase   :      List[str]			 =					self.model.config.idalabel[best_class]
           lowerCamelCase   :      List[str]			 =					probabilities[best_class].item()
           lowerCamelCase   :      Optional[Any]			 =					logits.tolist()
           return {"label": label, "score": score, "logits": logits}







"""simple docstring"""






from __future__ import annotations

import numpy as np


def 			UpperCAmelCase__       (				lowerCAmelCase__     :list[float]		) ->    Optional[Any]:
      '''simple docstring'''


      return np.maximum(0					,		lowerCAmelCase__		)


if __name__ == "__main__":
       print(np.array(relu([-1, 0, 5])))  # --> [0, 0, 5]



