




from ctypes import c_float, sizeof
from enum import Enum
from typing import TYPE_CHECKING, Optional, Union


if TYPE_CHECKING:
				from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore






class    __lowerCAmelCase			(	SCREAMING_SNAKE_CASE_			):
			snake_case_				:			str								=					c_float







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




									"""simple docstring"""


									return sizeof(self.value				)




def 							__SCREAMING_SNAKE_CASE  (      snake_case_     ,   snake_case_     ,   snake_case_ = 0						):

						'''simple docstring'''


						if dimension <= 0:
												_UpperCAmelCase													=					fixed_dimension

						dimension -= num_token_to_add
						return dimension


def 							__SCREAMING_SNAKE_CASE  (      snake_case_     ,   snake_case_						):

						'''simple docstring'''


						return num_parameters * dtype.size





def 							__SCREAMING_SNAKE_CASE  (      snake_case_						):

						'''simple docstring'''


						from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore

						try:
												return AutoProcessor.from_pretrained(snake_case_						)
						except (ValueError, OSError, KeyError):
												_UpperCAmelCase							,			_UpperCAmelCase													=					None, None
												try:
																		_UpperCAmelCase													=					AutoTokenizer.from_pretrained(snake_case_						)
												except (OSError, KeyError):
																		pass
												try:
																		_UpperCAmelCase													=					AutoFeatureExtractor.from_pretrained(snake_case_						)
												except (OSError, KeyError):
																		pass

												if tokenizer is not None and feature_extractor is not None:
																		raise ValueError(
																		    f"""Couldn't auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor."""						)
												elif tokenizer is None and feature_extractor is None:
																		return None
												elif tokenizer is not None:
																		return tokenizer
												else:
																		return feature_extractor












from typing import TYPE_CHECKING

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


lowercase_     :    int      =			{
    'configuration_videomae': ['VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VideoMAEConfig'],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_     :    List[str]      =			[
				    'VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'VideoMAEForPreTraining',
				    'VideoMAEModel',
				    'VideoMAEPreTrainedModel',
				    'VideoMAEForVideoClassification',
				]

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				lowercase_     :    Any      =			['VideoMAEFeatureExtractor']
				lowercase_     :    Dict      =			['VideoMAEImageProcessor']

if TYPE_CHECKING:
				from .configuration_videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_videomae import (
								    VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST,
								    VideoMAEForPreTraining,
								    VideoMAEForVideoClassification,
								    VideoMAEModel,
								    VideoMAEPreTrainedModel,
								)

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_videomae import VideoMAEFeatureExtractor
								from .image_processing_videomae import VideoMAEImageProcessor

else:
				import sys

				lowercase_     :    int      =			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




