


'''simple docstring'''



import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto import CONFIG_MAPPING


A__						:   int				=    logging.get_logger(__name__)

A__						:   Optional[Any]				=    {
    """ut/deta""": """https://huggingface.co/ut/deta/resolve/main/config.json""",
}





class   UpperCAmelCase_    (_UpperCAmelCase    ):





    """simple docstring"""






    lowerCamelCase    :   Tuple					=     'deta'
    lowerCamelCase    :   Tuple					=     {
        'hidden_size': 'd_model',
        'num_attention_heads': 'encoder_attention_heads',
    }







    def __init__(				self     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_=9_00     ,	SCREAMING_SNAKE_CASE_=20_48     ,	SCREAMING_SNAKE_CASE_=6     ,	SCREAMING_SNAKE_CASE_=20_48     ,	SCREAMING_SNAKE_CASE_=8     ,	SCREAMING_SNAKE_CASE_=6     ,	SCREAMING_SNAKE_CASE_=10_24     ,	SCREAMING_SNAKE_CASE_=8     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_="relu"     ,	SCREAMING_SNAKE_CASE_=2_56     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=0.0     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	SCREAMING_SNAKE_CASE_=1.0     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=False     ,	SCREAMING_SNAKE_CASE_="sine"     ,	SCREAMING_SNAKE_CASE_=5     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=3_00     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=True     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=5     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=5     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=0.1     ,	SCREAMING_SNAKE_CASE_=0.2_5     ,	**SCREAMING_SNAKE_CASE_     ,	)							->	Any:
         if backbone_config is None:
              logger.info('`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'      )
              __lowerCamelCase  :      Any														=						CONFIG_MAPPING['resnet'](out_features=['stage2', 'stage3', 'stage4']      )
         else:
              if isinstance(SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_      ):
                   __lowerCamelCase  :      Dict														=						backbone_config.pop('model_type'      )
                   __lowerCamelCase  :      List[str]														=						CONFIG_MAPPING[backbone_model_type]
                   __lowerCamelCase  :      int														=						config_class.from_dict(SCREAMING_SNAKE_CASE_      )

         __lowerCamelCase  :      str														=						backbone_config
         __lowerCamelCase  :      Dict														=						num_queries
         __lowerCamelCase  :      Dict														=						max_position_embeddings
         __lowerCamelCase  :      Tuple														=						d_model
         __lowerCamelCase  :      Optional[int]														=						encoder_ffn_dim
         __lowerCamelCase  :      Dict														=						encoder_layers
         __lowerCamelCase  :      Optional[int]														=						encoder_attention_heads
         __lowerCamelCase  :      str														=						decoder_ffn_dim
         __lowerCamelCase  :      int														=						decoder_layers
         __lowerCamelCase  :      int														=						decoder_attention_heads
         __lowerCamelCase  :      List[str]														=						dropout
         __lowerCamelCase  :      List[Any]														=						attention_dropout
         __lowerCamelCase  :      Union[str, Any]														=						activation_dropout
         __lowerCamelCase  :      str														=						activation_function
         __lowerCamelCase  :      Optional[Any]														=						init_std
         __lowerCamelCase  :      Optional[Any]														=						init_xavier_std
         __lowerCamelCase  :      Optional[int]														=						encoder_layerdrop
         __lowerCamelCase  :      str														=						auxiliary_loss
         __lowerCamelCase  :      Union[str, Any]														=						position_embedding_type
         # deformable attributes
         __lowerCamelCase  :      int														=						num_feature_levels
         __lowerCamelCase  :      List[str]														=						encoder_n_points
         __lowerCamelCase  :      Optional[Any]														=						decoder_n_points
         __lowerCamelCase  :      Tuple														=						two_stage
         __lowerCamelCase  :      List[str]														=						two_stage_num_proposals
         __lowerCamelCase  :      Optional[Any]														=						with_box_refine
         __lowerCamelCase  :      str														=						assign_first_stage
         if two_stage is True and with_box_refine is False:
              raise ValueError('If two_stage is True, with_box_refine must be True.'      )
         # Hungarian matcher
         __lowerCamelCase  :      List[Any]														=						class_cost
         __lowerCamelCase  :      str														=						bbox_cost
         __lowerCamelCase  :      Optional[Any]														=						giou_cost
         # Loss coefficients
         __lowerCamelCase  :      Optional[int]														=						mask_loss_coefficient
         __lowerCamelCase  :      Any														=						dice_loss_coefficient
         __lowerCamelCase  :      Optional[int]														=						bbox_loss_coefficient
         __lowerCamelCase  :      str														=						giou_loss_coefficient
         __lowerCamelCase  :      Tuple														=						eos_coefficient
         __lowerCamelCase  :      str														=						focal_alpha
         super().__init__(is_encoder_decoder=SCREAMING_SNAKE_CASE_     ,	**SCREAMING_SNAKE_CASE_      )







    @property
    def  lowercase_							(				self      )							->	int:
         return self.encoder_attention_heads







    @property
    def  lowercase_							(				self      )							->	int:
         return self.d_model







    def  lowercase_							(				self      )							->	Dict:
         __lowerCamelCase  :      List[str]														=						copy.deepcopy(self.__dict__      )
         __lowerCamelCase  :      Optional[Any]														=						self.backbone_config.to_dict()
         __lowerCamelCase  :      Optional[int]														=						self.__class__.model_type
         return output










'''simple docstring'''



from typing import TYPE_CHECKING

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


if is_sentencepiece_available():
      from ..ta.tokenization_ta import TaTokenizer
else:
      from ...utils.dummy_sentencepiece_objects import TaTokenizer

A__						:   int				=    TaTokenizer

if is_tokenizers_available():
      from ..ta.tokenization_ta_fast import TaTokenizerFast
else:
      from ...utils.dummy_tokenizers_objects import TaTokenizerFast

A__						:   Dict				=    TaTokenizerFast

A__						:   Dict				=    {"""configuration_mt5""": ["""MT5Config""", """MT5OnnxConfig"""]}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__						:   Any				=    [
          """MT5EncoderModel""",
          """MT5ForConditionalGeneration""",
          """MT5ForQuestionAnswering""",
          """MT5Model""",
          """MT5PreTrainedModel""",
          """MT5Stack""",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__						:   str				=    ["""TFMT5EncoderModel""", """TFMT5ForConditionalGeneration""", """TFMT5Model"""]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__						:   str				=    ["""FlaxMT5EncoderModel""", """FlaxMT5ForConditionalGeneration""", """FlaxMT5Model"""]


if TYPE_CHECKING:
      from .configuration_mta import MTaConfig, MTaOnnxConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mta import (
                MTaEncoderModel,
                MTaForConditionalGeneration,
                MTaForQuestionAnswering,
                MTaModel,
                MTaPreTrainedModel,
                MTaStack,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_mta import TFMTaEncoderModel, TFMTaForConditionalGeneration, TFMTaModel

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_mta import FlaxMTaEncoderModel, FlaxMTaForConditionalGeneration, FlaxMTaModel

else:
      import sys

      A__						:   Union[str, Any]				=    _LazyModule(
          __name__,
          globals()["""__file__"""],
          _import_structure,
          extra_objects={"""MT5Tokenizer""": MTaTokenizer, """MT5TokenizerFast""": MTaTokenizerFast},
          module_spec=__spec__,
      )






