
'''simple docstring'''







# Lint as: python3
# pylint: enable=line-too-long
# pylint: disable=g-import-not-at-top,g-bad-import-order,wrong-import-position

_lowercase :  str    							=       "2.13.1"

import platform

import pyarrow
from packaging import version


if version.parse(platform.python_version()) < version.parse("3.7"):
							raise ImportWarning(
							    "To use `datasets`, Python>=3.7 is required, and the current version of Python doesn't match this condition."
							)

if version.parse(pyarrow.__version__).major < 8:
							raise ImportWarning(
							    "To use `datasets`, the module `pyarrow>=8.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n"
							    "If you are running this in a Google Colab, you should probably just restart the runtime to use the right version of `pyarrow`."
							)

del platform
del pyarrow
del version

from .arrow_dataset import Dataset
from .arrow_reader import ReadInstruction
from .builder import ArrowBasedBuilder, BeamBasedBuilder, BuilderConfig, DatasetBuilder, GeneratorBasedBuilder
from .combine import concatenate_datasets, interleave_datasets
from .dataset_dict import DatasetDict, IterableDatasetDict
from .download import *
from .features import *
from .fingerprint import disable_caching, enable_caching, is_caching_enabled, set_caching_enabled
from .info import DatasetInfo, MetricInfo
from .inspect import (
    get_dataset_config_info,
    get_dataset_config_names,
    get_dataset_infos,
    get_dataset_split_names,
    inspect_dataset,
    inspect_metric,
    list_datasets,
    list_metrics,
)
from .iterable_dataset import IterableDataset
from .load import load_dataset, load_dataset_builder, load_from_disk, load_metric
from .metric import Metric
from .splits import (
    NamedSplit,
    NamedSplitAll,
    Split,
    SplitBase,
    SplitDict,
    SplitGenerator,
    SplitInfo,
    SubSplitInfo,
    percent,
)
from .tasks import *
from .utils import *
from .utils import logging


# deprecated modules
from datasets import arrow_dataset as _arrow_dataset  # isort:skip
from datasets import utils as _utils  # isort:skip
from datasets.utils import download_manager as _deprecated_download_manager  # isort:skip

_lowercase :  str    							=       concatenate_datasets
_lowercase :  Any    							=       DownloadConfig
_lowercase :  Tuple    							=       DownloadManager
_lowercase :  Dict    							=       DownloadMode
_lowercase :  Union[str, Any]    							=       DownloadConfig
_lowercase :  str    							=       DownloadMode
_lowercase :  Optional[int]    							=       DownloadManager

del _arrow_dataset, _utils, _deprecated_download_manager






'''simple docstring'''
import copy

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


lowerCamelCase :      Dict					 =     logging.get_logger(__name__)

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







class 							A__    (       A__  ):
  A__		 =				'deta'
  A__		 =				{
      'hidden_size': 'd_model',
      'num_attention_heads': 'encoder_attention_heads',
  }





  def __init__(		self      :	Tuple							,					_a      :	Optional[int]=None							,					_a      :	int=900							,					_a      :	Optional[Any]=2048							,					_a      :	int=6							,					_a      :	Tuple=2048							,					_a      :	Optional[int]=8							,					_a      :	Any=6							,					_a      :	str=1024							,					_a      :	int=8							,					_a      :	int=0.0							,					_a      :	Optional[Any]=True							,					_a      :	Tuple="relu"							,					_a      :	Union[str, Any]=256							,					_a      :	Tuple=0.1							,					_a      :	str=0.0							,					_a      :	Dict=0.0							,					_a      :	Tuple=0.02							,					_a      :	Union[str, Any]=1.0							,					_a      :	Any=True							,					_a      :	Tuple=False							,					_a      :	List[Any]="sine"							,					_a      :	str=5							,					_a      :	List[Any]=4							,					_a      :	str=4							,					_a      :	Union[str, Any]=True							,					_a      :	Optional[int]=300							,					_a      :	Dict=True							,					_a      :	List[Any]=True							,					_a      :	List[Any]=1							,					_a      :	List[str]=5							,					_a      :	int=2							,					_a      :	Dict=1							,					_a      :	str=1							,					_a      :	Optional[Any]=5							,					_a      :	Union[str, Any]=2							,					_a      :	List[str]=0.1							,					_a      :	List[Any]=0.25							,					**_a      :	Union[str, Any]							,					)	->    List[str]:





       '''simple docstring'''






       if backbone_config is None:
            logger.info('`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.' )
            _SCREAMING_SNAKE_CASE							    =CONFIG_MAPPING['resnet'](out_features=['stage2', 'stage3', 'stage4'] )
       else:
            if isinstance(_a							,					_a ):
                 _SCREAMING_SNAKE_CASE							    =backbone_config.pop('model_type' )
                 _SCREAMING_SNAKE_CASE							    =CONFIG_MAPPING[backbone_model_type]
                 _SCREAMING_SNAKE_CASE							    =config_class.from_dict(_a )

       _SCREAMING_SNAKE_CASE							    =backbone_config
       _SCREAMING_SNAKE_CASE							    =num_queries
       _SCREAMING_SNAKE_CASE							    =max_position_embeddings
       _SCREAMING_SNAKE_CASE							    =d_model
       _SCREAMING_SNAKE_CASE							    =encoder_ffn_dim
       _SCREAMING_SNAKE_CASE							    =encoder_layers
       _SCREAMING_SNAKE_CASE							    =encoder_attention_heads
       _SCREAMING_SNAKE_CASE							    =decoder_ffn_dim
       _SCREAMING_SNAKE_CASE							    =decoder_layers
       _SCREAMING_SNAKE_CASE							    =decoder_attention_heads
       _SCREAMING_SNAKE_CASE							    =dropout
       _SCREAMING_SNAKE_CASE							    =attention_dropout
       _SCREAMING_SNAKE_CASE							    =activation_dropout
       _SCREAMING_SNAKE_CASE							    =activation_function
       _SCREAMING_SNAKE_CASE							    =init_std
       _SCREAMING_SNAKE_CASE							    =init_xavier_std
       _SCREAMING_SNAKE_CASE							    =encoder_layerdrop
       _SCREAMING_SNAKE_CASE							    =auxiliary_loss
       _SCREAMING_SNAKE_CASE							    =position_embedding_type
       # deformable attributes
       _SCREAMING_SNAKE_CASE							    =num_feature_levels
       _SCREAMING_SNAKE_CASE							    =encoder_n_points
       _SCREAMING_SNAKE_CASE							    =decoder_n_points
       _SCREAMING_SNAKE_CASE							    =two_stage
       _SCREAMING_SNAKE_CASE							    =two_stage_num_proposals
       _SCREAMING_SNAKE_CASE							    =with_box_refine
       _SCREAMING_SNAKE_CASE							    =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
       _SCREAMING_SNAKE_CASE							    =class_cost
       _SCREAMING_SNAKE_CASE							    =bbox_cost
       _SCREAMING_SNAKE_CASE							    =giou_cost
       # Loss coefficients
       _SCREAMING_SNAKE_CASE							    =mask_loss_coefficient
       _SCREAMING_SNAKE_CASE							    =dice_loss_coefficient
       _SCREAMING_SNAKE_CASE							    =bbox_loss_coefficient
       _SCREAMING_SNAKE_CASE							    =giou_loss_coefficient
       _SCREAMING_SNAKE_CASE							    =eos_coefficient
       _SCREAMING_SNAKE_CASE							    =focal_alpha
       super().__init__(is_encoder_decoder=_a							,					**_a )





  @property
  def 						A  (		self      :	Dict )	->    int:





       '''simple docstring'''






       return self.encoder_attention_heads





  @property
  def 						A  (		self      :	List[Any] )	->    int:





       '''simple docstring'''






       return self.d_model





  def 						A  (		self      :	Optional[int] )	->    List[str]:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							    =copy.deepcopy(self.__dict__ )
       _SCREAMING_SNAKE_CASE							    =self.backbone_config.to_dict()
       _SCREAMING_SNAKE_CASE							    =self.__class__.model_type
       return output
