


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


_lowerCAmelCase:						Optional[int]   				=       logging.get_logger(__name__)

_lowerCAmelCase:						Any   				=       {
    'microsoft/beit-base-patch16-224-pt22k': (
        'https://huggingface.co/microsoft/beit-base-patch16-224-pt22k/resolve/main/config.json'
    ),
    # See all BEiT models at https://huggingface.co/models?filter=beit
}




class       lowercase_					(lowercase__   ):
				snake_case	    ='beit'





				def __init__(				self       ,  lowercase_=8192       ,  lowercase_=768       ,  lowercase_=12       ,  lowercase_=12       ,  lowercase_=3072       ,  lowercase_="gelu"       ,  lowercase_=0.0       ,  lowercase_=0.0       ,  lowercase_=0.02       ,  lowercase_=1e-12       ,  lowercase_=224       ,  lowercase_=16       ,  lowercase_=3       ,  lowercase_=False       ,  lowercase_=False       ,  lowercase_=False       ,  lowercase_=False       ,  lowercase_=0.1       ,  lowercase_=0.1       ,  lowercase_=True       ,  lowercase_=[3, 5, 7, 11]       ,  lowercase_=[1, 2, 3, 6]       ,  lowercase_=True       ,  lowercase_=0.4       ,  lowercase_=256       ,  lowercase_=1       ,  lowercase_=False       ,  lowercase_=255       ,  **lowercase_       ,  )  -> Optional[int]:
											super().__init__(**lowercase_)

											a__      =vocab_size
											a__      =hidden_size
											a__      =num_hidden_layers
											a__      =num_attention_heads
											a__      =intermediate_size
											a__      =hidden_act
											a__      =hidden_dropout_prob
											a__      =attention_probs_dropout_prob
											a__      =initializer_range
											a__      =layer_norm_eps

											a__      =image_size
											a__      =patch_size
											a__      =num_channels
											a__      =use_mask_token
											a__      =use_absolute_position_embeddings
											a__      =use_relative_position_bias
											a__      =use_shared_relative_position_bias
											a__      =layer_scale_init_value
											a__      =drop_path_rate
											a__      =use_mean_pooling
											# decode head attributes (semantic segmentation)
											a__      =out_indices
											a__      =pool_scales
											# auxiliary head attributes (semantic segmentation)
											a__      =use_auxiliary_head
											a__      =auxiliary_loss_weight
											a__      =auxiliary_channels
											a__      =auxiliary_num_convs
											a__      =auxiliary_concat_input
											a__      =semantic_loss_ignore_index







class       lowercase_					(lowercase__   ):
				snake_case	    =version.parse('1.11'   )





				@property
				def 						__UpperCamelCase    (				self)  -> Mapping[str, Mapping[int, str]]:
											return OrderedDict(
											    [
											        ('pixel_values', {0: 'batch', 1: 'num_channels', 2: 'height', 3: 'width'}),
											    ])





				@property
				def 						__UpperCamelCase    (				self)  -> float:
											return 1e-4






from typing import TYPE_CHECKING

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


a_    :  Tuple						  =		{'configuration_unispeech': ['UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP', 'UniSpeechConfig']}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_    :  Union[str, Any]						  =		[
         'UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST',
         'UniSpeechForCTC',
         'UniSpeechForPreTraining',
         'UniSpeechForSequenceClassification',
         'UniSpeechModel',
         'UniSpeechPreTrainedModel',
     ]

if TYPE_CHECKING:
     from .configuration_unispeech import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_unispeech import (
              UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST,
              UniSpeechForCTC,
              UniSpeechForPreTraining,
              UniSpeechForSequenceClassification,
              UniSpeechModel,
              UniSpeechPreTrainedModel,
          )

else:
     import sys

     a_    :  Optional[Any]						  =		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)