





'''simple docstring'''


import numpy as np

from transformers import Pipeline


def 	__a(SCREAMING_SNAKE_CASE_  :					Tuple    ):



    '''simple docstring'''





    _lowerCAmelCase				=      np.max(SCREAMING_SNAKE_CASE_		,       axis=-1		,       keepdims=SCREAMING_SNAKE_CASE_    )
    _lowerCAmelCase				=      np.exp(outputs - maxes    )
    return shifted_exp / shifted_exp.sum(axis=-1		,       keepdims=SCREAMING_SNAKE_CASE_    )





class    lowerCAmelCase_		(		__magic_name__		):




 def 							_snake_case   (	self			,     **_lowerCAmelCase		)    ->							str:
     _lowerCAmelCase				=      {}
     if "second_text" in kwargs:
         _lowerCAmelCase				=      kwargs["second_text"]
     return preprocess_kwargs, {}, {}




 def 							_snake_case   (	self			,     _lowerCAmelCase			,     _lowerCAmelCase=None		)    ->							Tuple:
     return self.tokenizer(_lowerCAmelCase			,     text_pair=_lowerCAmelCase			,     return_tensors=self.framework		)




 def 							_snake_case   (	self			,     _lowerCAmelCase		)    ->							List[str]:
     return self.model(**_lowerCAmelCase		)





 def 							_snake_case   (	self			,     _lowerCAmelCase		)    ->							Union[str, Any]:
     _lowerCAmelCase				=      model_outputs.logits[0].numpy()
     _lowerCAmelCase				=      softmax(_lowerCAmelCase		)

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











'''simple docstring'''


def 	__a(SCREAMING_SNAKE_CASE_  :					int    ):



    '''simple docstring'''





    if not isinstance(SCREAMING_SNAKE_CASE_		,       SCREAMING_SNAKE_CASE_    ):
        raise TypeError("Input value must be an 'int' type"    )

    _lowerCAmelCase				=      0
    while number:
        position += 1
        number >>= 1

    return position


if __name__ == "__main__":
       import doctest

       doctest.testmod()


