


import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..bit import BitConfig


lowerCAmelCase__      		= logging.get_logger(__name__)

lowerCAmelCase__      		= {
    'Intel/dpt-large': 'https://huggingface.co/Intel/dpt-large/resolve/main/config.json',
    # See all DPT models at https://huggingface.co/models?filter=dpt
}







class      lowerCAmelCase__       (				a):




     '''simple docstring'''
     __SCREAMING_SNAKE_CASE  			= "dpt"


     def __init__(						self ,						__lowerCamelCase=7_6_8 ,						__lowerCamelCase=1_2 ,						__lowerCamelCase=1_2 ,						__lowerCamelCase=3_0_7_2 ,						__lowerCamelCase="gelu" ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0 ,						__lowerCamelCase=0.0_2 ,						__lowerCamelCase=1e-12 ,						__lowerCamelCase=3_8_4 ,						__lowerCamelCase=1_6 ,						__lowerCamelCase=3 ,						__lowerCamelCase=False ,						__lowerCamelCase=True ,						__lowerCamelCase=[2, 5, 8, 1_1] ,						__lowerCamelCase="project" ,						__lowerCamelCase=[4, 2, 1, 0.5] ,						__lowerCamelCase=[9_6, 1_9_2, 3_8_4, 7_6_8] ,						__lowerCamelCase=2_5_6 ,						__lowerCamelCase=-1 ,						__lowerCamelCase=False ,						__lowerCamelCase=True ,						__lowerCamelCase=0.4 ,						__lowerCamelCase=2_5_5 ,						__lowerCamelCase=0.1 ,						__lowerCamelCase=[1, 1_0_2_4, 2_4, 2_4] ,						__lowerCamelCase=[0, 1] ,						__lowerCamelCase=None ,						**__lowerCamelCase ,						)			->				Optional[Any]:
            super().__init__(**__lowerCamelCase)

            _A      :       Any				    = hidden_size
            _A      :       Dict				    = is_hybrid

            if self.is_hybrid:
                   if backbone_config is None:
                          logger.info("Initializing the config with a `BiT` backbone.")
                          _A      :       int				    = {
                              "global_padding": "same",
                              "layer_type": "bottleneck",
                              "depths": [3, 4, 9],
                              "out_features": ["stage1", "stage2", "stage3"],
                              "embedding_dynamic_padding": True,
                          }
                          _A      :       Dict				    = BitConfig(**__lowerCamelCase)
                   elif isinstance(__lowerCamelCase ,						__lowerCamelCase):
                          logger.info("Initializing the config with a `BiT` backbone.")
                          _A      :       Optional[Any]				    = BitConfig(**__lowerCamelCase)
                   elif isinstance(__lowerCamelCase ,						__lowerCamelCase):
                          _A      :       List[str]				    = backbone_config
                   else:
                          raise ValueError(
                              F"backbone_config must be a dictionary or a `PretrainedConfig`, got {backbone_config.__class__}.")

                   _A      :       Any				    = backbone_featmap_shape
                   _A      :       Optional[Any]				    = neck_ignore_stages

                   if readout_type != "project":
                          raise ValueError("Readout type must be 'project' when using `DPT-hybrid` mode.")
            else:
                   _A      :       List[Any]				    = None
                   _A      :       List[str]				    = None
                   _A      :       int				    = []

            _A      :       Any				    = num_hidden_layers
            _A      :       List[str]				    = num_attention_heads
            _A      :       Any				    = intermediate_size
            _A      :       int				    = hidden_act
            _A      :       int				    = hidden_dropout_prob
            _A      :       Tuple				    = attention_probs_dropout_prob
            _A      :       str				    = initializer_range
            _A      :       Optional[Any]				    = layer_norm_eps
            _A      :       Optional[Any]				    = image_size
            _A      :       Any				    = patch_size
            _A      :       List[Any]				    = num_channels
            _A      :       Union[str, Any]				    = qkv_bias
            _A      :       List[Any]				    = backbone_out_indices
            if readout_type not in ["ignore", "add", "project"]:
                   raise ValueError("Readout_type must be one of ['ignore', 'add', 'project']")
            _A      :       int				    = readout_type
            _A      :       Union[str, Any]				    = reassemble_factors
            _A      :       str				    = neck_hidden_sizes
            _A      :       Optional[Any]				    = fusion_hidden_size
            _A      :       Union[str, Any]				    = head_in_index
            _A      :       List[str]				    = use_batch_norm_in_fusion_residual
            # auxiliary head attributes (semantic segmentation)
            _A      :       str				    = use_auxiliary_head
            _A      :       Union[str, Any]				    = auxiliary_loss_weight
            _A      :       Any				    = semantic_loss_ignore_index
            _A      :       Any				    = semantic_classifier_dropout


     def  _lowerCamelCase (						self)			->				Dict:
            _A      :       str				    = copy.deepcopy(self.__dict__)

            if output["backbone_config"] is not None:
                   _A      :       Optional[Any]				    = self.backbone_config.to_dict()

            _A      :       Optional[int]				    = self.__class__.model_type
            return output




from typing import TYPE_CHECKING

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


lowerCAmelCase__      		= {'configuration_speech_encoder_decoder': ['SpeechEncoderDecoderConfig']}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase__      		= ['SpeechEncoderDecoderModel']

try:
    if not is_flax_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    lowerCAmelCase__      		= ['FlaxSpeechEncoderDecoderModel']

if TYPE_CHECKING:
    from .configuration_speech_encoder_decoder import SpeechEncoderDecoderConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_speech_encoder_decoder import SpeechEncoderDecoderModel

    try:
        if not is_flax_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_flax_speech_encoder_decoder import FlaxSpeechEncoderDecoderModel

else:
    import sys

    lowerCAmelCase__      		= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
