



import warnings

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






class 				SCREAMING_SNAKE_CASE     (							lowerCamelCase__   ):
							__lowerCamelCase		:		Tuple      =["image_processor", "tokenizer"]
							__lowerCamelCase		:		Optional[Any]      ="VideoMAEImageProcessor"
							__lowerCamelCase		:		str      =("CLIPTokenizer", "CLIPTokenizerFast")





							def __init__(				self						:						Tuple ,			__lowercase						:						Any=None ,			__lowercase						:						Optional[int]=None ,			**__lowercase						:						Tuple		):

											'''simple docstring'''
											__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.""" ,			lowercase__ ,			)
															__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__(lowercase__ ,			lowercase__		)
											__a					       =						self.image_processor





							def __call__(				self						:						Any ,			__lowercase						:						List[Any]=None ,			__lowercase						:						Optional[Any]=None ,			__lowercase						:						int=None ,			**__lowercase						:						Optional[Any]		):

											'''simple docstring'''







											if text is None and videos is None:
															raise ValueError("""You have to specify either text or videos. Both cannot be none."""		)

											if text is not None:
															__a					       =						self.tokenizer(lowercase__ ,			return_tensors=lowercase__ ,			**lowercase__		)

											if videos is not None:
															__a					       =						self.image_processor(lowercase__ ,			return_tensors=lowercase__ ,			**lowercase__		)

											if text is not None and videos is not None:
															__a					       =						image_features.pixel_values
															return encoding
											elif text is not None:
															return encoding
											else:
															return BatchEncoding(data=dict(**lowercase__		) ,			tensor_type=lowercase__		)





							def   UpperCamelCase_   (				self						:						Union[str, Any] ,			*__lowercase						:						List[Any] ,			**__lowercase						:						Optional[Any]		):

											'''simple docstring'''
											return self.tokenizer.batch_decode(*lowercase__ ,			**lowercase__		)





							def   UpperCamelCase_   (				self						:						int ,			*__lowercase						:						List[str] ,			**__lowercase						:						Optional[int]		):

											'''simple docstring'''
											return self.tokenizer.decode(*lowercase__ ,			**lowercase__		)





							@property
							def   UpperCamelCase_   (				self						:						Union[str, Any]		):

											'''simple docstring'''
											return ["input_ids", "attention_mask", "position_ids", "pixel_values"]





							@property
							def   UpperCamelCase_   (				self						:						Tuple		):

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







							@property
							def   UpperCamelCase_   (				self						:						List[str]		):

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





from typing import TYPE_CHECKING

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


lowerCamelCase__     =	{"""configuration_hubert""": ["""HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """HubertConfig"""]}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__     =	[
						    """HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """HubertForCTC""",
						    """HubertForSequenceClassification""",
						    """HubertModel""",
						    """HubertPreTrainedModel""",
						]


try:
						if not is_tf_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCamelCase__     =	[
						    """TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
						    """TFHubertForCTC""",
						    """TFHubertModel""",
						    """TFHubertPreTrainedModel""",
						]

if TYPE_CHECKING:
						from .configuration_hubert import HUBERT_PRETRAINED_CONFIG_ARCHIVE_MAP, HubertConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_hubert import (
												    HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    HubertForCTC,
												    HubertForSequenceClassification,
												    HubertModel,
												    HubertPreTrainedModel,
												)

						try:
												if not is_tf_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_tf_hubert import (
												    TF_HUBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
												    TFHubertForCTC,
												    TFHubertModel,
												    TFHubertPreTrainedModel,
												)


else:
						import sys

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