






import warnings
from typing import List, Optional, Union

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
from ...utils import TensorType


class       __SCREAMING_SNAKE_CASE   (				__lowercase):
						_SCREAMING_SNAKE_CASE		:    Dict						=   ['''image_processor''', '''tokenizer''']
						_SCREAMING_SNAKE_CASE		:    Union[str, Any]						=   '''ViltImageProcessor'''
						_SCREAMING_SNAKE_CASE		:    str						=   ('''BertTokenizer''', '''BertTokenizerFast''')






						def __init__(		self       ,  _UpperCamelCase=None       ,  _UpperCamelCase=None       ,  **_UpperCamelCase				):






												"""simple docstring"""
												lowerCAmelCase__        =  None
												if "feature_extractor" in kwargs:
																		warnings.warn(
																		    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
																		    ' instead.'       ,  _UpperCamelCase       ,  )
																		lowerCAmelCase__        =  kwargs.pop('feature_extractor'				)

												lowerCAmelCase__        =  image_processor if image_processor is not None else feature_extractor
												if image_processor is None:
																		raise ValueError('You need to specify an `image_processor`.'				)
												if tokenizer is None:
																		raise ValueError('You need to specify a `tokenizer`.'				)

												super().__init__(_UpperCamelCase       ,  _UpperCamelCase				)
												lowerCAmelCase__        =  self.image_processor






						def __call__(		self       ,  _UpperCamelCase       ,  _UpperCamelCase = None       ,  _UpperCamelCase = True       ,  _UpperCamelCase = False       ,  _UpperCamelCase = None       ,  _UpperCamelCase = None       ,  _UpperCamelCase = 0       ,  _UpperCamelCase = None       ,  _UpperCamelCase = None       ,  _UpperCamelCase = None       ,  _UpperCamelCase = False       ,  _UpperCamelCase = False       ,  _UpperCamelCase = False       ,  _UpperCamelCase = False       ,  _UpperCamelCase = True       ,  _UpperCamelCase = None       ,  **_UpperCamelCase       ,  ):






												"""simple docstring"""
												lowerCAmelCase__        =  self.tokenizer(
												    text=_UpperCamelCase       ,  add_special_tokens=_UpperCamelCase       ,  padding=_UpperCamelCase       ,  truncation=_UpperCamelCase       ,  max_length=_UpperCamelCase       ,  stride=_UpperCamelCase       ,  pad_to_multiple_of=_UpperCamelCase       ,  return_token_type_ids=_UpperCamelCase       ,  return_attention_mask=_UpperCamelCase       ,  return_overflowing_tokens=_UpperCamelCase       ,  return_special_tokens_mask=_UpperCamelCase       ,  return_offsets_mapping=_UpperCamelCase       ,  return_length=_UpperCamelCase       ,  verbose=_UpperCamelCase       ,  return_tensors=_UpperCamelCase       ,  **_UpperCamelCase       ,  )
												# add pixel_values + pixel_mask
												lowerCAmelCase__        =  self.image_processor(_UpperCamelCase       ,  return_tensors=_UpperCamelCase				)
												encoding.update(_UpperCamelCase				)

												return encoding






						def  UpperCamelCase__ (		self       ,  *_UpperCamelCase       ,  **_UpperCamelCase				):






												"""simple docstring"""
												return self.tokenizer.batch_decode(*_UpperCamelCase       ,  **_UpperCamelCase				)






						def  UpperCamelCase__ (		self       ,  *_UpperCamelCase       ,  **_UpperCamelCase				):






												"""simple docstring"""
												return self.tokenizer.decode(*_UpperCamelCase       ,  **_UpperCamelCase				)






						@property
						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												lowerCAmelCase__        =  self.tokenizer.model_input_names
												lowerCAmelCase__        =  self.image_processor.model_input_names
												return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names				)				)






						@property
						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												warnings.warn(
												    '`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'       ,  _UpperCamelCase       ,  )
												return self.image_processor_class







						@property
						def  UpperCamelCase__ (		self				):






												"""simple docstring"""
												warnings.warn(
												    '`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'       ,  _UpperCamelCase       ,  )
												return self.image_processor













from .glue import GlueDataset, GlueDataTrainingArguments
from .language_modeling import (
    LineByLineTextDataset,
    LineByLineWithRefDataset,
    LineByLineWithSOPTextDataset,
    TextDataset,
    TextDatasetForNextSentencePrediction,
)
from .squad import SquadDataset, SquadDataTrainingArguments





