"""simple docstring"""







import warnings

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



class 			_lowerCamelCase      (__lowerCamelCase  ):
				_snake_case  =	["image_processor", "tokenizer"]
				_snake_case  =	"AutoImageProcessor"
				_snake_case  =	"AutoTokenizer"







				def __init__(			self     :							int      ,       lowerCamelCase_     :							Any=None      ,       lowerCamelCase_     :							Any=None      ,       **lowerCamelCase_     :							Any    ):

					"""simple docstring"""






					_lowercase			:     List[str]      					=				None
					if "feature_extractor" in kwargs:
						warnings.warn(
						    'The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'
						    ' instead.'      ,       lowerCamelCase_      ,       )
						_lowercase			:     str      					=				kwargs.pop('feature_extractor'    )

					_lowercase			:     int      					=				image_processor if image_processor is not None else feature_extractor
					if image_processor is None:
						raise ValueError('You have to specify an image_processor.'    )
					if tokenizer is None:
						raise ValueError('You have to specify a tokenizer.'    )

					super().__init__(lowerCamelCase_      ,       lowerCamelCase_    )
					_lowercase			:     str      					=				self.image_processor







				def __call__(			self     :							str      ,       lowerCamelCase_     :							Dict=None      ,       lowerCamelCase_     :							int=None      ,       lowerCamelCase_     :							Optional[Any]=None      ,       **lowerCamelCase_     :							str    ):

					"""simple docstring"""






					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:
						_lowercase			:     int      					=				self.tokenizer(lowerCamelCase_      ,       return_tensors=lowerCamelCase_      ,       **lowerCamelCase_    )

					if images is not None:
						_lowercase			:     Optional[int]      					=				self.image_processor(lowerCamelCase_      ,       return_tensors=lowerCamelCase_      ,       **lowerCamelCase_    )

					if text is not None and images is not None:
						_lowercase			:     Union[str, Any]      					=				image_features.pixel_values
						return encoding
					elif text is not None:
						return encoding
					else:
						return BatchEncoding(data=dict(**lowerCamelCase_    )      ,       tensor_type=lowerCamelCase_    )







				def 				__UpperCAmelCase       (			self     :							Tuple      ,       *lowerCamelCase_     :							str      ,       **lowerCamelCase_     :							Tuple    ):

					"""simple docstring"""






					return self.tokenizer.batch_decode(*lowerCamelCase_      ,       **lowerCamelCase_    )







				def 				__UpperCAmelCase       (			self     :							str      ,       *lowerCamelCase_     :							Optional[int]      ,       **lowerCamelCase_     :							Dict    ):

					"""simple docstring"""






					return self.tokenizer.decode(*lowerCamelCase_      ,       **lowerCamelCase_    )







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

					"""simple docstring"""






					_lowercase			:     Optional[Any]      					=				self.tokenizer.model_input_names
					_lowercase			:     Optional[int]      					=				self.image_processor.model_input_names
					return list(dict.fromkeys(tokenizer_input_names + image_processor_input_names    )    )







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

					"""simple docstring"""






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







				@property
				def 				__UpperCAmelCase       (			self     :							Optional[Any]    ):

					"""simple docstring"""






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




"""simple docstring"""







from ...configuration_utils import PretrainedConfig
from ...utils import logging


SCREAMING_SNAKE_CASE						=    logging.get_logger(__name__)

SCREAMING_SNAKE_CASE						=    {
    'facebook/regnet-y-040': 'https://huggingface.co/facebook/regnet-y-040/blob/main/config.json',
}



class 			_lowerCamelCase      (__lowerCamelCase  ):
				_snake_case  =	"regnet"
				_snake_case  =	["x", "y"]







				def __init__(			self     :							Any      ,       lowerCamelCase_     :							Optional[Any]=3      ,       lowerCamelCase_     :							List[str]=3_2      ,       lowerCamelCase_     :							str=[1_2_8, 1_9_2, 5_1_2, 1_0_8_8]      ,       lowerCamelCase_     :							int=[2, 6, 1_2, 2]      ,       lowerCamelCase_     :							Union[str, Any]=6_4      ,       lowerCamelCase_     :							int="y"      ,       lowerCamelCase_     :							Optional[Any]="relu"      ,       **lowerCamelCase_     :							Optional[Any]      ,       ):

					"""simple docstring"""






					super().__init__(**lowerCamelCase_    )
					if layer_type not in self.layer_types:
						raise ValueError(F'''layer_type={layer_type} is not one of {','.join(self.layer_types    )}'''    )
					_lowercase			:     str      					=				num_channels
					_lowercase			:     Optional[Any]      					=				embedding_size
					_lowercase			:     Union[str, Any]      					=				hidden_sizes
					_lowercase			:     Optional[int]      					=				depths
					_lowercase			:     Optional[int]      					=				groups_width
					_lowercase			:     Tuple      					=				layer_type
					_lowercase			:     Union[str, Any]      					=				hidden_act
					# always downsample in the first stage
					_lowercase			:     Optional[int]      					=				True



