


from typing import Optional, Union

from ...file_utils import TensorType
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, TruncationStrategy



class      snake_case__	(   _A	):
				__lowerCAmelCase		=   '''MarkupLMFeatureExtractor'''
				__lowerCAmelCase		=   ('''MarkupLMTokenizer''', '''MarkupLMTokenizerFast''')
				__lowerCAmelCase		=   True
				def __call__(	self  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=None  ,   _UpperCAmelCase=None  ,   _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"""




										if self.parse_html:
																if html_strings is None:
																						raise ValueError('Make sure to pass HTML strings in case `parse_html` is set to `True`'   )

																if nodes is not None or xpaths is not None or node_labels is not None:
																						raise ValueError(
																						    'Please don\'t pass nodes, xpaths nor node labels in case `parse_html` is set to `True`'   )

																__magic_name__					:				int				=   self.feature_extractor(_UpperCAmelCase   )
																__magic_name__					:				Union[str, Any]				=   features['nodes']
																__magic_name__					:				Tuple				=   features['xpaths']
										else:
																if html_strings is not None:
																						raise ValueError('You have passed HTML strings but `parse_html` is set to `False`.'   )
																if nodes is None or xpaths is None:
																						raise ValueError('Make sure to pass nodes and xpaths in case `parse_html` is set to `False`'   )

        # # second, apply the tokenizer
										if questions is not None and self.parse_html:
																if isinstance(_UpperCAmelCase  ,   _UpperCAmelCase   ):
																						__magic_name__					:				str				=   [questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

										__magic_name__					:				Dict				=   self.tokenizer(
										    text=questions if questions is not None else nodes  ,   text_pair=nodes if questions is not None else None  ,   xpaths=_UpperCAmelCase  ,   node_labels=_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  ,   )

										return encoded_inputs
				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"""




										__magic_name__					:				str				=   self.tokenizer.model_input_names
										return tokenizer_input_names






# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
    is_vision_available,
)


snake_case__  				=			{
    'configuration_tvlt': ['TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TvltConfig'],
    'feature_extraction_tvlt': ['TvltFeatureExtractor'],
    'processing_tvlt': ['TvltProcessor'],
}

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			snake_case__  				=			[
			    'TVLT_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'TvltModel',
			    'TvltForPreTraining',
			    'TvltForAudioVisualClassification',
			    'TvltPreTrainedModel',
			]

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			snake_case__  				=			['TvltImageProcessor']


if TYPE_CHECKING:
			from .configuration_tvlt import TVLT_PRETRAINED_CONFIG_ARCHIVE_MAP, TvltConfig
			from .processing_tvlt import TvltProcessor
			from .feature_extraction_tvlt import TvltFeatureExtractor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_tvlt import (
						    TVLT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    TvltForAudioVisualClassification,
						    TvltForPreTraining,
						    TvltModel,
						    TvltPreTrainedModel,
						)

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .image_processing_tvlt import TvltImageProcessor


else:
			import sys

			snake_case__  				=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


