


from ...configuration_utils import PretrainedConfig
from ...utils import logging


_lowercase       :      Tuple	=	logging.get_logger(__name__)

_lowercase       :      Optional[Any]	=	{
    "google/fnet-base": "https://huggingface.co/google/fnet-base/resolve/main/config.json",
    "google/fnet-large": "https://huggingface.co/google/fnet-large/resolve/main/config.json"
    # See all FNet models at https://huggingface.co/models?filter=fnet
}






class       _UpperCamelCase    (					__snake_case				):

				"""simple docstring"""







				lowerCAmelCase 		= 'fnet'

				def __init__(						self				,   a__=3_2000				,   a__=768				,   a__=12				,   a__=3072				,   a__="gelu_new"				,   a__=0.1				,   a__=512				,   a__=4				,   a__=0.02				,   a__=1e-12				,   a__=False				,   a__=512				,   a__=3				,   a__=1				,   a__=2				,   **a__				,   )	->				List[Any]:
					super().__init__(pad_token_id=a__				,   bos_token_id=a__				,   eos_token_id=a__				,   **a__   )

					A								=				vocab_size
					A								=				max_position_embeddings
					A								=				hidden_size
					A								=				num_hidden_layers
					A								=				intermediate_size
					A								=				hidden_act
					A								=				hidden_dropout_prob
					A								=				initializer_range
					A								=				type_vocab_size
					A								=				layer_norm_eps
					A								=				use_tpu_fourier_optimizations
					A								=				tpu_short_seq_length



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       _UpperCamelCase    (					__snake_case				):

				"""simple docstring"""







				lowerCAmelCase 		= ['image_processor', 'tokenizer']
				lowerCAmelCase 		= 'ViltImageProcessor'
				lowerCAmelCase 		= ('BertTokenizer', 'BertTokenizerFast')

				def __init__(						self				,   a__=None				,   a__=None				,   **a__   )	->				Any:
					A								=				None
					if "feature_extractor" in kwargs:
						warnings.warn(
						    """The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"""
						    """ instead."""				,   a__				,   )
						A								=				kwargs.pop("""feature_extractor"""   )

					A								=				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__(a__				,   a__   )
					A								=				self.image_processor

				def __call__(						self				,   a__				,   a__ = None				,   a__ = True				,   a__ = False				,   a__ = None				,   a__ = None				,   a__ = 0				,   a__ = None				,   a__ = None				,   a__ = None				,   a__ = False				,   a__ = False				,   a__ = False				,   a__ = False				,   a__ = True				,   a__ = None				,   **a__				,   )	->				BatchEncoding:
					A								=				self.tokenizer(
					    text=a__				,   add_special_tokens=a__				,   padding=a__				,   truncation=a__				,   max_length=a__				,   stride=a__				,   pad_to_multiple_of=a__				,   return_token_type_ids=a__				,   return_attention_mask=a__				,   return_overflowing_tokens=a__				,   return_special_tokens_mask=a__				,   return_offsets_mapping=a__				,   return_length=a__				,   verbose=a__				,   return_tensors=a__				,   **a__				,   )
					# add pixel_values + pixel_mask
					A								=				self.image_processor(a__				,   return_tensors=a__   )
					encoding.update(a__   )

					return encoding

				def      _UpperCAmelCase					(						self				,   *a__				,   **a__   )	->				Union[str, Any]:
					return self.tokenizer.batch_decode(*a__				,   **a__   )

				def      _UpperCAmelCase					(						self				,   *a__				,   **a__   )	->				Any:
					return self.tokenizer.decode(*a__				,   **a__   )

				@property
				def      _UpperCAmelCase					(						self   )	->				int:
					A								=				self.tokenizer.model_input_names
					A								=				self.image_processor.model_input_names
					return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names   )   )

				@property
				def      _UpperCAmelCase					(						self   )	->				str:
					warnings.warn(
					    """`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead."""				,   a__				,   )
					return self.image_processor_class

				@property
				def      _UpperCAmelCase					(						self   )	->				str:
					warnings.warn(
					    """`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead."""				,   a__				,   )
					return self.image_processor



