



'''simple docstring'''


from typing import Dict

from .base import GenericTensor, Pipeline

class  SCREAMING_SNAKE_CASE (  _a		):






    """simple docstring"""





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


       """simple docstring"""







       if tokenize_kwargs is None:
          UpperCamelCase					=  {}

       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)' )
          UpperCamelCase					=  truncation

       UpperCamelCase					=  tokenize_kwargs

       UpperCamelCase					=  {}
       if return_tensors is not None:
          UpperCamelCase					=  return_tensors

       return preprocess_params, {}, postprocess_params






    def  A       (  self      :					List[Any]  ,						UpperCamelCase__      :					int  ,						**UpperCamelCase__      :					Union[str, Any] ):


       """simple docstring"""







       UpperCamelCase					=  self.framework
       UpperCamelCase					=  self.tokenizer(UpperCamelCase__  ,						return_tensors=UpperCamelCase__  ,						**UpperCamelCase__ )
       return model_inputs






    def  A       (  self      :					Any  ,						UpperCamelCase__      :					str ):


       """simple docstring"""







       UpperCamelCase					=  self.model(**UpperCamelCase__ )
       return model_outputs






    def  A       (  self      :					Optional[int]  ,						UpperCamelCase__      :					Union[str, Any]  ,						UpperCamelCase__      :					List[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      :					Tuple  ,						*UpperCamelCase__      :					Tuple  ,						**UpperCamelCase__      :					str ):


       """simple docstring"""







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






'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCamelCase	:       Tuple      	=	{"configuration_ibert": ["IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP", "IBertConfig", "IBertOnnxConfig"]}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase	:       Dict      	=	[
       "IBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
       "IBertForMaskedLM",
       "IBertForMultipleChoice",
       "IBertForQuestionAnswering",
       "IBertForSequenceClassification",
       "IBertForTokenClassification",
       "IBertModel",
       "IBertPreTrainedModel",
   ]

if TYPE_CHECKING:
   from .configuration_ibert import IBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, IBertConfig, IBertOnnxConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_ibert import (
          IBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
          IBertForMaskedLM,
          IBertForMultipleChoice,
          IBertForQuestionAnswering,
          IBertForSequenceClassification,
          IBertForTokenClassification,
          IBertModel,
          IBertPreTrainedModel,
      )

else:
   import sys

   _lowerCamelCase	:       Union[str, Any]      	=	_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)

