class_docstr: Constructs a FLAVA processor which wraps a FLAVA feature extractor and a FLAVA tokenizer into a single processor.
  
  [`FlavaProcessor`] offers all the functionalities of [`FlavaFeatureExtractor`] and [`BertTokenizerFast`]. See the
  [`~FlavaProcessor.__call__`] and [`~FlavaProcessor.decode`] for more information.
  
  Args:
      feature_extractor ([`FlavaFeatureExtractor`]): The feature extractor is a required input.
      tokenizer ([`BertTokenizerFast`]): The tokenizer is a required input.
class_docstr_tok: ["Constructs","a","FLAVA","processor","which","wraps","a","FLAVA","feature","extractor","and","a","FLAVA","tokenizer","into","a","single","processor",".","[","`","FlavaProcessor","`","]","offers","all","the","functionalities","of","[","`","FlavaFeatureExtractor","`","]","and","[","`","BertTokenizerFast","`","]",".","See","the","[","`","~FlavaProcessor.__call__","`","]","and","[","`","~FlavaProcessor.decode","`","]","for","more","information",".","Args",":","feature_extractor","(","[","`","FlavaFeatureExtractor","`","]",")",":","The","feature","extractor","is","a","required","input",".","tokenizer","(","[","`","BertTokenizerFast","`","]",")",":","The","tokenizer","is","a","required","input","."]
docstr: This method uses [`FLAVAFeatureExtractor.__call__`] method to prepare image(s) for the model, and
  [`BertTokenizerFast.__call__`] to prepare text for the model.
  
  Please refer to the docstring of the above two methods for more information.
docstr_tok: ["This","method","uses","[","`","FLAVAFeatureExtractor.__call__","`","]","method","to","prepare","image","(","s",")","for","the","model",",","and","[","`","BertTokenizerFast.__call__","`","]","to","prepare","text","for","the","model",".","Please","refer","to","the","docstring","of","the","above","two","methods","for","more","information","."]
code: def __call__(
      self,
      images: Optional[ImageInput] = None,
      text: Optional[
          Union[
              TextInput,
              PreTokenizedInput,
              List[TextInput],
              List[PreTokenizedInput],
          ]
      ] = None,
      add_special_tokens: bool = True,
      padding: Union[bool, str, PaddingStrategy] = False,
      truncation: Union[bool, str, TruncationStrategy] = False,
      max_length: Optional[int] = None,
      stride: int = 0,
      pad_to_multiple_of: Optional[int] = None,
      return_image_mask: Optional[bool] = None,
      return_codebook_pixels: Optional[bool] = None,
      return_token_type_ids: Optional[bool] = None,
      return_attention_mask: Optional[bool] = None,
      return_overflowing_tokens: bool = False,
      return_special_tokens_mask: bool = False,
      return_offsets_mapping: bool = False,
      return_length: bool = False,
      verbose: bool = True,
      return_tensors: Optional[Union[str, TensorType]] = None,
      **kwargs,
  ):
      """
      This method uses [`FLAVAFeatureExtractor.__call__`] method to prepare image(s) for the model, and
      [`BertTokenizerFast.__call__`] to prepare text for the model.
  
      Please refer to the docstring of the above two methods for more information.
      """
  
      if text is None and images is None:
          raise ValueError(
              "You have to specify either text or images. Both cannot be none."
          )
  
      if text is not None:
          encoding = self.tokenizer(
              text=text,
              add_special_tokens=add_special_tokens,
              padding=padding,
              truncation=truncation,
              max_length=max_length,
              stride=stride,
              pad_to_multiple_of=pad_to_multiple_of,
              return_token_type_ids=return_token_type_ids,
              return_attention_mask=return_attention_mask,
              return_overflowing_tokens=return_overflowing_tokens,
              return_special_tokens_mask=return_special_tokens_mask,
              return_offsets_mapping=return_offsets_mapping,
              return_length=return_length,
              verbose=verbose,
              return_tensors=return_tensors,
              **kwargs,
          )
      if images is not None:
          image_features = self.feature_extractor(
              images,
              return_image_mask=return_image_mask,
              return_codebook_pixels=return_codebook_pixels,
              return_tensors=return_tensors,
              **kwargs,
          )
  
      if text is not None and images is not None:
          encoding.update(image_features)
          return encoding
      elif text is not None:
          return encoding
      else:
          return BatchEncoding(
              data=dict(**image_features), tensor_type=return_tensors
          )
  
file_path: H2O/h2o_flexgen/benchmark/third_party/transformers/src/transformers/models/flava/processing_flava.py
imports: from typing import List, Optional, Union
  from ...image_utils import ImageInput
  from ...processing_utils import ProcessorMixin
  from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
  from ...utils import TensorType
label_desc: Use image node_id 2 for calling the FlavaProcessor obj's underlying member method code with example usage: obj.__call__(images, text, add_special_tokens, padding, truncation, max_length, stride, pad_to_multiple_of, return_image_mask, return_codebook_pixels, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, return_tensors) and returns: encoding, encoding, BatchEncoding