






# 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

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


SCREAMING_SNAKE_CASE__      :			Tuple							=		{
    """configuration_efficientnet""": [
        """EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """EfficientNetConfig""",
        """EfficientNetOnnxConfig""",
    ]
}

try:
					if not is_vision_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__      :			Union[str, Any]							=		["""EfficientNetImageProcessor"""]

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE__      :			Optional[Any]							=		[
					    """EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """EfficientNetForImageClassification""",
					    """EfficientNetModel""",
					    """EfficientNetPreTrainedModel""",
					]

if TYPE_CHECKING:
					from .configuration_efficientnet import (
					    EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    EfficientNetConfig,
					    EfficientNetOnnxConfig,
					)

					try:
										if not is_vision_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .image_processing_efficientnet import EfficientNetImageProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_efficientnet import (
										    EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
										    EfficientNetForImageClassification,
										    EfficientNetModel,
										    EfficientNetPreTrainedModel,
										)

else:
					import sys

					SCREAMING_SNAKE_CASE__      :			Dict							=		_LazyModule(__name__, globals()["""__file__"""], _import_structure)














from ...processing_utils import ProcessorMixin
class 						lowerCamelCase_				(      lowerCamelCase ):
				a__					       =  '''WhisperFeatureExtractor'''
				a__					       =  '''WhisperTokenizer'''







				def __init__(						self       ,					__lowerCAmelCase       ,					__lowerCAmelCase     ):
								"""simple docstring"""
								super().__init__(__lowerCAmelCase       ,					__lowerCAmelCase     )
								__magic_name__		:int        =      self.feature_extractor
								__magic_name__		:int        =      False







				def 			A	(						self       ,					__lowerCAmelCase=None       ,					__lowerCAmelCase=None       ,					__lowerCAmelCase=True     ):
								"""simple docstring"""
								return self.tokenizer.get_decoder_prompt_ids(task=__lowerCAmelCase       ,					language=__lowerCAmelCase       ,					no_timestamps=__lowerCAmelCase     )







				def __call__(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								# For backward compatibility
								if self._in_target_context_manager:
												return self.current_processor(*__lowerCAmelCase       ,					**__lowerCAmelCase     )

								__magic_name__		:List[Any]        =      kwargs.pop('''audio'''       ,					__lowerCAmelCase     )
								__magic_name__		:Any        =      kwargs.pop('''sampling_rate'''       ,					__lowerCAmelCase     )
								__magic_name__		:str        =      kwargs.pop('''text'''       ,					__lowerCAmelCase     )
								if len(__lowerCAmelCase     ) > 0:
												__magic_name__		:Any        =      args[0]
												__magic_name__		:Union[str, Any]        =      args[1:]

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

								if audio is not None:
												__magic_name__		:Optional[int]        =      self.feature_extractor(__lowerCAmelCase       ,					*__lowerCAmelCase       ,					sampling_rate=__lowerCAmelCase       ,					**__lowerCAmelCase     )
								if text is not None:
												__magic_name__		:Optional[int]        =      self.tokenizer(__lowerCAmelCase       ,					**__lowerCAmelCase     )

								if text is None:
												return inputs

								elif audio is None:
												return encodings
								else:
												__magic_name__		:str        =      encodings['''input_ids''']
												return inputs







				def 			A	(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								return self.tokenizer.batch_decode(*__lowerCAmelCase       ,					**__lowerCAmelCase     )







				def 			A	(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								return self.tokenizer.decode(*__lowerCAmelCase       ,					**__lowerCAmelCase     )







				def 			A	(						self       ,					__lowerCAmelCase       ,					__lowerCAmelCase="np"     ):
								"""simple docstring"""
								return self.tokenizer.get_prompt_ids(__lowerCAmelCase       ,					return_tensors=__lowerCAmelCase     )






