






"""simple docstring"""




from ...configuration_utils import PretrainedConfig
from ...utils import logging


__magic_name__:					List[Any]							=     logging.get_logger(__name__)

__magic_name__:					Any							=     {
    "naver-clova-ix/donut-base": "https://huggingface.co/naver-clova-ix/donut-base/resolve/main/config.json",
    # See all Donut models at https://huggingface.co/models?filter=donut-swin
}





class 	snake_case__ (							_lowerCAmelCase				):
	lowercase__						:					int											=   '''donut-swin'''

	lowercase__						:					Any											=   {
	    '''num_attention_heads''': '''num_heads''',
	    '''num_hidden_layers''': '''num_layers''',
	}
	def __init__(    self      ,       lowerCAmelCase__=2_24      ,       lowerCAmelCase__=4      ,       lowerCAmelCase__=3      ,       lowerCAmelCase__=96      ,       lowerCAmelCase__=[2, 2, 6, 2]      ,       lowerCAmelCase__=[3, 6, 12, 24]      ,       lowerCAmelCase__=7      ,       lowerCAmelCase__=4.0      ,       lowerCAmelCase__=True      ,       lowerCAmelCase__=0.0      ,       lowerCAmelCase__=0.0      ,       lowerCAmelCase__=0.1      ,       lowerCAmelCase__="gelu"      ,       lowerCAmelCase__=False      ,       lowerCAmelCase__=0.0_2      ,       lowerCAmelCase__=1e-5      ,       **lowerCAmelCase__      ,       )							->				List[Any]:
							super().__init__(**lowerCAmelCase__			)

							__magic_name__      :       Optional[Any]       						= image_size
							__magic_name__      :       Optional[Any]       						= patch_size
							__magic_name__      :       Optional[int]       						= num_channels
							__magic_name__      :       Tuple       						= embed_dim
							__magic_name__      :       Union[str, Any]       						= depths
							__magic_name__      :       Any       						= len(lowerCAmelCase__			)
							__magic_name__      :       Optional[int]       						= num_heads
							__magic_name__      :       Optional[Any]       						= window_size
							__magic_name__      :       Union[str, Any]       						= mlp_ratio
							__magic_name__      :       Union[str, Any]       						= qkv_bias
							__magic_name__      :       Any       						= hidden_dropout_prob
							__magic_name__      :       Optional[Any]       						= attention_probs_dropout_prob
							__magic_name__      :       Tuple       						= drop_path_rate
							__magic_name__      :       Tuple       						= hidden_act
							__magic_name__      :       Optional[Any]       						= use_absolute_embeddings
							__magic_name__      :       Any       						= layer_norm_eps
							__magic_name__      :       Any       						= initializer_range
							# we set the hidden_size attribute in order to make Swin work with VisionEncoderDecoderModel
							# this indicates the channel dimension after the last stage of the model
							__magic_name__      :       int       						= int(embed_dim * 2 ** (len(lowerCAmelCase__			) - 1)			)








import sys

from .dependency_versions_table import deps
from .utils.versions import require_version, require_version_core


# define which module versions we always want to check at run time
# (usually the ones defined in `install_requires` in setup.py)
#
# order specific notes:
# - tqdm must be checked before tokenizers

__magic_name__:					int							=     "python tqdm regex requests packaging filelock numpy tokenizers".split()
if sys.version_info < (3, 7):
		pkgs_to_check_at_runtime.append("dataclasses")
if sys.version_info < (3, 8):
		pkgs_to_check_at_runtime.append("importlib_metadata")

for pkg in pkgs_to_check_at_runtime:
		if pkg in deps:
				if pkg == "tokenizers":
						# must be loaded here, or else tqdm check may fail
						from .utils import is_tokenizers_available

						if not is_tokenizers_available():
								continue  # not required, check version only if installed

				require_version_core(deps[pkg])
		else:
				raise ValueError(F"""can't find {pkg} in {deps.keys()}, check dependency_versions_table.py""")

def    UpperCamelCase						(	_A,   _A=None			):






						"""simple docstring"""







						require_version(deps[pkg],   _A			)
