






'''simple docstring'''
from typing import Dict

from .base import GenericTensor, Pipeline


class        _UpperCAmelCase						(		snake_case			):




    def 				lowerCAmelCase__				(			self  :       List[str]  ,     a  :       Optional[int]=None  ,     a  :       int=None  ,     a  :       Any=None  ,     **a  :       Dict			):






       '''simple docstring'''






       if tokenize_kwargs is None:
          lowercase_	:    Any           =     {}

       if truncation is not None:
          if "truncation" in tokenize_kwargs:
             raise ValueError(
                 "truncation parameter defined twice (given as keyword argument as well as in tokenize_kwargs)"			)
          lowercase_	:    List[str]           =     truncation

       lowercase_	:    Optional[int]           =     tokenize_kwargs

       lowercase_	:    Union[str, Any]           =     {}
       if return_tensors is not None:
          lowercase_	:    Union[str, Any]           =     return_tensors

       return preprocess_params, {}, postprocess_params




    def 				lowerCAmelCase__				(			self  :       int  ,     a  :       Dict  ,     **a  :       List[Any]			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     self.framework
       lowercase_	:    Optional[int]           =     self.tokenizer(a  ,     return_tensors=a  ,     **a			)
       return model_inputs




    def 				lowerCAmelCase__				(			self  :       Dict  ,     a  :       List[Any]			):






       '''simple docstring'''






       lowercase_	:    str           =     self.model(**a			)
       return model_outputs




    def 				lowerCAmelCase__				(			self  :       int  ,     a  :       Optional[int]  ,     a  :       str=False			):






       '''simple docstring'''






       if return_tensors:
          return model_outputs[0]
       if self.framework == "pt":
          return model_outputs[0].tolist()
       elif self.framework == "tf":
          return model_outputs[0].numpy().tolist()





    def __call__(			self  :       List[str]  ,     *a  :       Optional[int]  ,     **a  :       List[Any]			):






       '''simple docstring'''






       return super().__call__(*a  ,     **a			)












'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   if number < 0:
      raise ValueError("number must not be negative"							)
   return number & (number - 1) == 0


if __name__ == "__main__":
 import doctest

 doctest.testmod()




