






"""simple docstring"""






from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE						:						List[Any]					   =       {
    '''configuration_ctrl''': ['''CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''CTRLConfig'''],
    '''tokenization_ctrl''': ['''CTRLTokenizer'''],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE						:						Tuple					   =       [
					    '''CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''CTRLForSequenceClassification''',
					    '''CTRLLMHeadModel''',
					    '''CTRLModel''',
					    '''CTRLPreTrainedModel''',
					]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE						:						Union[str, Any]					   =       [
					    '''TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST''',
					    '''TFCTRLForSequenceClassification''',
					    '''TFCTRLLMHeadModel''',
					    '''TFCTRLModel''',
					    '''TFCTRLPreTrainedModel''',
					]


if TYPE_CHECKING:
					from .configuration_ctrl import CTRL_PRETRAINED_CONFIG_ARCHIVE_MAP, CTRLConfig
					from .tokenization_ctrl import CTRLTokenizer

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_ctrl import (
										    CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    CTRLForSequenceClassification,
										    CTRLLMHeadModel,
										    CTRLModel,
										    CTRLPreTrainedModel,
										)

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_ctrl import (
										    TF_CTRL_PRETRAINED_MODEL_ARCHIVE_LIST,
										    TFCTRLForSequenceClassification,
										    TFCTRLLMHeadModel,
										    TFCTRLModel,
										    TFCTRLPreTrainedModel,
										)

else:
					import sys

					SCREAMING_SNAKE_CASE						:						Tuple					   =       _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)










"""simple docstring"""






from ...processing_utils import ProcessorMixin





class       snake_case_       (    _lowerCamelCase       ):



	"""simple docstring"""

	SCREAMING_SNAKE_CASE_:							Union[str, Any]   			=					["""image_processor""", """feature_extractor"""]
	SCREAMING_SNAKE_CASE_:							Optional[int]   			=					"""TvltImageProcessor"""
	SCREAMING_SNAKE_CASE_:							Optional[int]   			=					"""TvltFeatureExtractor"""


	def __init__(      self  ,					__a  ,					__a						):


					"""simple docstring"""

					super().__init__(image_processor=__a  ,					feature_extractor=__a						)

					A__							 =       image_processor
					A__							 =       feature_extractor


	def __call__(      self  ,					__a=None  ,					__a=None  ,					__a=None  ,					__a=None  ,					__a=False  ,					__a=False  ,					*__a  ,					**__a  ,					):


					"""simple docstring"""

					if images is None and audio is None:
									raise ValueError('You need to specify either an `images` or `audio` input to process.'						)

					A__							 =       None
					if images is not None:
									A__							 =       self.image_processor(__a  ,					mask_pixel=__a  ,					*__a  ,					**__a						)
					if images_mixed is not None:
									A__							 =       self.image_processor(__a  ,					is_mixed=__a  ,					*__a  ,					**__a						)
					if audio is not None:
									A__							 =       self.feature_extractor(
									    __a  ,					*__a  ,					sampling_rate=__a  ,					mask_audio=__a  ,					**__a						)

					A__							 =       {}
					if audio is not None:
									output_dict.update(__a						)
					if images is not None:
									output_dict.update(__a						)
					if images_mixed_dict is not None:
									output_dict.update(__a						)
					return output_dict






	@property
	def       _UpperCAmelCase						(      self						):


					"""simple docstring"""

					A__							 =       self.image_processor.model_input_names
					A__							 =       self.feature_extractor.model_input_names
					return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names						)						)


