





from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


UpperCAmelCase_      							=     logging.get_logger(__name__)

UpperCAmelCase_      							=     {
    """google/bit-50""": """https://huggingface.co/google/bit-50/resolve/main/config.json""",
}
class 			UpperCamelCase_		(  _lowerCamelCase							,  _lowerCamelCase					):
					lowerCAmelCase_							=	'''bit'''
					lowerCAmelCase_							=	['''preactivation''', '''bottleneck''']
					lowerCAmelCase_							=	['''SAME''', '''VALID''']




					def __init__(		self				,						lowerCAmelCase_=3				,						lowerCAmelCase_=64				,						lowerCAmelCase_=[256, 512, 1024, 2048]				,						lowerCAmelCase_=[3, 4, 6, 3]				,						lowerCAmelCase_="preactivation"				,						lowerCAmelCase_="relu"				,						lowerCAmelCase_=None				,						lowerCAmelCase_=32				,						lowerCAmelCase_=0.0				,						lowerCAmelCase_=False				,						lowerCAmelCase_=32				,						lowerCAmelCase_=1				,						lowerCAmelCase_=None				,						lowerCAmelCase_=None				,						**lowerCAmelCase_				,						)		->							Tuple:
										super().__init__(**lowerCAmelCase_  )
										if layer_type not in self.layer_types:
															raise ValueError(F'''layer_type={layer_type} is not one of {",".join(self.layer_types  )}'''  )
										if global_padding is not None:
															if global_padding.upper() in self.supported_padding:
																				_snake_case									=				global_padding.upper()
															else:
																				raise ValueError(F'''Padding strategy {global_padding} not supported'''  )
										_snake_case									=				num_channels
										_snake_case									=				embedding_size
										_snake_case									=				hidden_sizes
										_snake_case									=				depths
										_snake_case									=				layer_type
										_snake_case									=				hidden_act
										_snake_case									=				global_padding
										_snake_case									=				num_groups
										_snake_case									=				drop_path_rate
										_snake_case									=				embedding_dynamic_padding
										_snake_case									=				output_stride
										_snake_case									=				width_factor

										_snake_case									=				['stem'] + [F'''stage{idx}''' for idx in range(1				,						len(lowerCAmelCase_  ) + 1  )]
										_snake_case							,     _snake_case									=				get_aligned_output_features_output_indices(
										    out_features=lowerCAmelCase_				,						out_indices=lowerCAmelCase_				,						stage_names=self.stage_names  )










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase_      							=     {
    """configuration_luke""": ["""LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP""", """LukeConfig"""],
    """tokenization_luke""": ["""LukeTokenizer"""],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_      							=     [
					    """LUKE_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """LukeForEntityClassification""",
					    """LukeForEntityPairClassification""",
					    """LukeForEntitySpanClassification""",
					    """LukeForMultipleChoice""",
					    """LukeForQuestionAnswering""",
					    """LukeForSequenceClassification""",
					    """LukeForTokenClassification""",
					    """LukeForMaskedLM""",
					    """LukeModel""",
					    """LukePreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_luke import LUKE_PRETRAINED_CONFIG_ARCHIVE_MAP, LukeConfig
					from .tokenization_luke import LukeTokenizer

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_luke import (
										    LUKE_PRETRAINED_MODEL_ARCHIVE_LIST,
										    LukeForEntityClassification,
										    LukeForEntityPairClassification,
										    LukeForEntitySpanClassification,
										    LukeForMaskedLM,
										    LukeForMultipleChoice,
										    LukeForQuestionAnswering,
										    LukeForSequenceClassification,
										    LukeForTokenClassification,
										    LukeModel,
										    LukePreTrainedModel,
										)

else:
					import sys

					UpperCAmelCase_      							=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



