
"""simple docstring"""






from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding




class      _SCREAMING_SNAKE_CASE   (     _lowercase				):
			UpperCAmelCase_    :Union[str, Any]												=		['''image_processor''', '''tokenizer''']
			UpperCAmelCase_    :Optional[int]												=		'''EfficientNetImageProcessor'''
			UpperCAmelCase_    :Optional[Any]												=		('''BertTokenizer''', '''BertTokenizerFast''')






			def __init__(   self			,  __A			,  __A			)     ->	str:
						super().__init__(lowerCamelCase__			,  lowerCamelCase__			)






			def __call__(   self			,  __A=None			,  __A=None			,  __A="max_length"			,  __A=64			,  __A=None			,  **__A			)     ->	List[str]:




						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:
									lowerCAmelCase_       :int     	=    self.tokenizer(
									    lowerCamelCase__			,  padding=lowerCamelCase__			,  max_length=lowerCamelCase__			,  return_tensors=lowerCamelCase__			,  **lowerCamelCase__			)

						if images is not None:
									lowerCAmelCase_       :int     	=    self.image_processor(lowerCamelCase__			,  return_tensors=lowerCamelCase__			,  **lowerCamelCase__			)

						if text is not None and images is not None:
									lowerCAmelCase_       :List[str]     	=    image_features.pixel_values
									return encoding
						elif text is not None:
									return encoding
						else:
									return BatchEncoding(data=dict(**lowerCamelCase__			)			,  tensor_type=lowerCamelCase__			)






			def 					__lowerCAmelCase					(   self			,  *__A			,  **__A			)     ->	int:
						return self.tokenizer.batch_decode(*lowerCamelCase__			,  **lowerCamelCase__			)






			def 					__lowerCAmelCase					(   self			,  *__A			,  **__A			)     ->	Optional[Any]:
						return self.tokenizer.decode(*lowerCamelCase__			,  **lowerCamelCase__			)






			@property
			def 					__lowerCAmelCase					(   self			)     ->	Tuple:
						lowerCAmelCase_       :Dict     	=    self.tokenizer.model_input_names
						lowerCAmelCase_       :Optional[int]     	=    self.image_processor.model_input_names
						return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names			)			)










"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


lowercase  		=			{
    """configuration_flaubert""": ["""FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FlaubertConfig""", """FlaubertOnnxConfig"""],
    """tokenization_flaubert""": ["""FlaubertTokenizer"""],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowercase  		=			[
					    """FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """FlaubertForMultipleChoice""",
					    """FlaubertForQuestionAnswering""",
					    """FlaubertForQuestionAnsweringSimple""",
					    """FlaubertForSequenceClassification""",
					    """FlaubertForTokenClassification""",
					    """FlaubertModel""",
					    """FlaubertWithLMHeadModel""",
					    """FlaubertPreTrainedModel""",
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					lowercase  		=			[
					    """TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """TFFlaubertForMultipleChoice""",
					    """TFFlaubertForQuestionAnsweringSimple""",
					    """TFFlaubertForSequenceClassification""",
					    """TFFlaubertForTokenClassification""",
					    """TFFlaubertModel""",
					    """TFFlaubertPreTrainedModel""",
					    """TFFlaubertWithLMHeadModel""",
					]


if TYPE_CHECKING:
					from .configuration_flaubert import FLAUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, FlaubertConfig, FlaubertOnnxConfig
					from .tokenization_flaubert import FlaubertTokenizer

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flaubert import (
										    FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
										    FlaubertForMultipleChoice,
										    FlaubertForQuestionAnswering,
										    FlaubertForQuestionAnsweringSimple,
										    FlaubertForSequenceClassification,
										    FlaubertForTokenClassification,
										    FlaubertModel,
										    FlaubertPreTrainedModel,
										    FlaubertWithLMHeadModel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_flaubert import (
										    TF_FLAUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFFlaubertForMultipleChoice,
										    TFFlaubertForQuestionAnsweringSimple,
										    TFFlaubertForSequenceClassification,
										    TFFlaubertForTokenClassification,
										    TFFlaubertModel,
										    TFFlaubertPreTrainedModel,
										    TFFlaubertWithLMHeadModel,
										)

else:
					import sys

					lowercase  		=			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





