


from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


UpperCAmelCase_				:			int   =	logging.get_logger(__name__)

UpperCAmelCase_				:			Optional[Any]   =	{
    'google/vit-base-patch16-224': 'https://huggingface.co/vit-base-patch16-224/resolve/main/config.json',
    # See all ViT models at https://huggingface.co/models?filter=vit
}
class 			SCREAMING_SNAKE_CASE__  (    lowercase__      ):
      snake_case__    :					Optional[Any]					       =						'''vit'''
      def __init__(	self    :	str					,							SCREAMING_SNAKE_CASE__    :	Tuple=7_6_8					,							SCREAMING_SNAKE_CASE__    :	str=1_2					,							SCREAMING_SNAKE_CASE__    :	Any=1_2					,							SCREAMING_SNAKE_CASE__    :	Tuple=3_0_7_2					,							SCREAMING_SNAKE_CASE__    :	Optional[int]="gelu"					,							SCREAMING_SNAKE_CASE__    :	Union[str, Any]=0.0					,							SCREAMING_SNAKE_CASE__    :	Optional[int]=0.0					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=0.02					,							SCREAMING_SNAKE_CASE__    :	int=1E-12					,							SCREAMING_SNAKE_CASE__    :	str=2_2_4					,							SCREAMING_SNAKE_CASE__    :	Optional[Any]=1_6					,							SCREAMING_SNAKE_CASE__    :	List[str]=3					,							SCREAMING_SNAKE_CASE__    :	List[str]=True					,							SCREAMING_SNAKE_CASE__    :	Dict=1_6					,							**SCREAMING_SNAKE_CASE__    :	Union[str, Any]					,							)		->      List[str]:
             super().__init__(**SCREAMING_SNAKE_CASE__					)

             a_ :		Tuple							=  hidden_size
             a_ :		Optional[int]							=  num_hidden_layers
             a_ :		int							=  num_attention_heads
             a_ :		Union[str, Any]							=  intermediate_size
             a_ :		str							=  hidden_act
             a_ :		Union[str, Any]							=  hidden_dropout_prob
             a_ :		int							=  attention_probs_dropout_prob
             a_ :		str							=  initializer_range
             a_ :		Dict							=  layer_norm_eps
             a_ :		Tuple							=  image_size
             a_ :		List[Any]							=  patch_size
             a_ :		Union[str, Any]							=  num_channels
             a_ :		Dict							=  qkv_bias
             a_ :		Optional[int]							=  encoder_stride
class 			SCREAMING_SNAKE_CASE__  (    lowercase__      ):
      snake_case__    :					str					       =						version.parse('''1.11'''      )
      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	Union[str, Any]					)		->      Mapping[str, Mapping[int, str]]:
             return OrderedDict(
                 [
                     ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
                 ]					)

      @property
      def 	SCREAMING_SNAKE_CASE							(	self    :	Union[str, Any]					)		->      float:
             return 1E-4






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCAmelCase_				:			Union[str, Any]   =	{
    'configuration_whisper': ['WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'WhisperConfig', 'WhisperOnnxConfig'],
    'feature_extraction_whisper': ['WhisperFeatureExtractor'],
    'processing_whisper': ['WhisperProcessor'],
    'tokenization_whisper': ['WhisperTokenizer'],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_				:			Optional[Any]   =	['WhisperTokenizerFast']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_				:			int   =	[
       'WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'WhisperForConditionalGeneration',
       'WhisperModel',
       'WhisperPreTrainedModel',
       'WhisperForAudioClassification',
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_				:			int   =	[
       'TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST',
       'TFWhisperForConditionalGeneration',
       'TFWhisperModel',
       'TFWhisperPreTrainedModel',
   ]

try:
   if not is_flax_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   UpperCAmelCase_				:			Any   =	[
       'FlaxWhisperForConditionalGeneration',
       'FlaxWhisperModel',
       'FlaxWhisperPreTrainedModel',
       'FlaxWhisperForAudioClassification',
   ]


if TYPE_CHECKING:
   from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig
   from .feature_extraction_whisper import WhisperFeatureExtractor
   from .processing_whisper import WhisperProcessor
   from .tokenization_whisper import WhisperTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_whisper_fast import WhisperTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_whisper import (
          WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
          WhisperForAudioClassification,
          WhisperForConditionalGeneration,
          WhisperModel,
          WhisperPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_whisper import (
          TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFWhisperForConditionalGeneration,
          TFWhisperModel,
          TFWhisperPreTrainedModel,
      )

   try:
      if not is_flax_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_flax_whisper import (
          FlaxWhisperForAudioClassification,
          FlaxWhisperForConditionalGeneration,
          FlaxWhisperModel,
          FlaxWhisperPreTrainedModel,
      )

else:
   import sys

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


