



"""simple docstring"""


import os
import shutil
import sys
import tempfile
import unittest
from pathlib import Path

import pytest

import transformers
from transformers import (
    BERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
    GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP,
    AutoTokenizer,
    BertConfig,
    BertTokenizer,
    BertTokenizerFast,
    CTRLTokenizer,
    GPTaTokenizer,
    GPTaTokenizerFast,
    PreTrainedTokenizerFast,
    RobertaTokenizer,
    RobertaTokenizerFast,
    is_tokenizers_available,
)
from transformers.models.auto.configuration_auto import CONFIG_MAPPING, AutoConfig
from transformers.models.auto.tokenization_auto import (
    TOKENIZER_MAPPING,
    get_tokenizer_config,
    tokenizer_class_from_name,
)
from transformers.models.roberta.configuration_roberta import RobertaConfig
from transformers.testing_utils import (
    DUMMY_DIFF_TOKENIZER_IDENTIFIER,
    DUMMY_UNKNOWN_IDENTIFIER,
    SMALL_MODEL_IDENTIFIER,
    RequestCounter,
    require_tokenizers,
    slow,
)


sys.path.append(str(Path(__file__).parent.parent.parent.parent / """utils"""))

from test_module.custom_configuration import CustomConfig  # noqa E402
from test_module.custom_tokenization import CustomTokenizer  # noqa E402


if is_tokenizers_available():
				from test_module.custom_tokenization_fast import CustomTokenizerFast







class       A_			(     unittest.TestCase				):



						"""simple docstring"""






						def 	UpperCAmelCase__     (					self :Optional[int]					)				->			Tuple:
												UpperCAmelCase             = 0






						@slow
						def 	UpperCAmelCase__     (					self :int					)				->			int:
												for model_name in (x for x in BERT_PRETRAINED_CONFIG_ARCHIVE_MAP.keys() if "japanese" not in x):
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
																		self.assertIsNotNone(lowercase_					)
																		self.assertIsInstance(lowercase_   ,  (BertTokenizer, BertTokenizerFast)					)
																		self.assertGreater(len(lowercase_					)   ,  0					)

												for model_name in GPT2_PRETRAINED_CONFIG_ARCHIVE_MAP.keys():
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
																		self.assertIsNotNone(lowercase_					)
																		self.assertIsInstance(lowercase_   ,  (GPTaTokenizer, GPTaTokenizerFast)					)
																		self.assertGreater(len(lowercase_					)   ,  0					)






						def 	UpperCAmelCase__     (					self :List[Any]					)				->			Optional[Any]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
												self.assertIsInstance(lowercase_   ,  (BertTokenizer, BertTokenizerFast)					)
												self.assertEqual(tokenizer.vocab_size   ,  12					)






						def 	UpperCAmelCase__     (					self :Union[str, Any]					)				->			Union[str, Any]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
												self.assertIsInstance(lowercase_   ,  (RobertaTokenizer, RobertaTokenizerFast)					)
												self.assertEqual(tokenizer.vocab_size   ,  20					)






						def 	UpperCAmelCase__     (					self :Union[str, Any]					)				->			Any:
												UpperCAmelCase             = AutoConfig.from_pretrained(lowercase_					)
												self.assertIsInstance(lowercase_   ,  lowercase_					)
												# Check that tokenizer_type ≠ model_type
												UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  config=lowercase_					)
												self.assertIsInstance(lowercase_   ,  (BertTokenizer, BertTokenizerFast)					)
												self.assertEqual(tokenizer.vocab_size   ,  12					)






						def 	UpperCAmelCase__     (					self :int					)				->			Optional[Any]:
												with tempfile.TemporaryDirectory() as tmp_dir:
																		shutil.copy('./tests/fixtures/vocab.txt'   ,  os.path.join(lowercase_   ,  'vocab.txt'					)					)

																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  tokenizer_type='bert'   ,  use_fast=lowercase_					)
																		self.assertIsInstance(lowercase_   ,  lowercase_					)

												with tempfile.TemporaryDirectory() as tmp_dir:
																		shutil.copy('./tests/fixtures/vocab.json'   ,  os.path.join(lowercase_   ,  'vocab.json'					)					)
																		shutil.copy('./tests/fixtures/merges.txt'   ,  os.path.join(lowercase_   ,  'merges.txt'					)					)

																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  tokenizer_type='gpt2'   ,  use_fast=lowercase_					)
																		self.assertIsInstance(lowercase_   ,  lowercase_					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :Tuple					)				->			int:
												with tempfile.TemporaryDirectory() as tmp_dir:
																		shutil.copy('./tests/fixtures/vocab.txt'   ,  os.path.join(lowercase_   ,  'vocab.txt'					)					)

																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  tokenizer_type='bert'					)
																		self.assertIsInstance(lowercase_   ,  lowercase_					)

												with tempfile.TemporaryDirectory() as tmp_dir:
																		shutil.copy('./tests/fixtures/vocab.json'   ,  os.path.join(lowercase_   ,  'vocab.json'					)					)
																		shutil.copy('./tests/fixtures/merges.txt'   ,  os.path.join(lowercase_   ,  'merges.txt'					)					)

																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  tokenizer_type='gpt2'					)
																		self.assertIsInstance(lowercase_   ,  lowercase_					)






						def 	UpperCAmelCase__     (					self :List[Any]					)				->			List[Any]:
												with pytest.raises(lowercase_					):
																		AutoTokenizer.from_pretrained('./'   ,  tokenizer_type='xxx'					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :Optional[Any]					)				->			List[str]:
												for tokenizer_class in [BertTokenizer, BertTokenizerFast, AutoTokenizer]:
																		UpperCAmelCase             = tokenizer_class.from_pretrained('wietsedv/bert-base-dutch-cased'					)
																		self.assertIsInstance(lowercase_   ,  (BertTokenizer, BertTokenizerFast)					)

																		if isinstance(lowercase_   ,  lowercase_					):
																								self.assertEqual(tokenizer.basic_tokenizer.do_lower_case   ,  lowercase_					)
																		else:
																								self.assertEqual(tokenizer.do_lower_case   ,  lowercase_					)

																		self.assertEqual(tokenizer.model_max_length   ,  5_12					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :int					)				->			str:
												for tokenizer_class in [BertTokenizer, BertTokenizerFast, AutoTokenizer]:
																		with self.assertRaisesRegex(
																		    lowercase_   ,  'julien-c/herlolip-not-exists is not a local folder and is not a valid model identifier'   ,  ):
																								UpperCAmelCase             = tokenizer_class.from_pretrained('julien-c/herlolip-not-exists'					)






						def 	UpperCAmelCase__     (					self :List[Any]					)				->			List[Any]:
												# tests: https://github.com/huggingface/transformers/pull/13251
												# 1. models with `-`, e.g. xlm-roberta -> xlm_roberta
												# 2. models that don't remap 1-1 from model-name to model file, e.g., openai-gpt -> openai
												UpperCAmelCase             = TOKENIZER_MAPPING.values()
												UpperCAmelCase             = []

												for slow_tok, fast_tok in tokenizers:
																		if slow_tok is not None:
																								tokenizer_names.append(slow_tok.__name__					)

																		if fast_tok is not None:
																								tokenizer_names.append(fast_tok.__name__					)

												for tokenizer_name in tokenizer_names:
																		# must find the right class
																		tokenizer_class_from_name(lowercase_					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :Tuple					)				->			List[str]:
												self.assertIsInstance(AutoTokenizer.from_pretrained('bert-base-cased'   ,  use_fast=lowercase_					)   ,  lowercase_					)
												self.assertIsInstance(AutoTokenizer.from_pretrained('bert-base-cased'					)   ,  lowercase_					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :Union[str, Any]					)				->			Optional[int]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained('distilbert-base-uncased'   ,  do_lower_case=lowercase_					)
												UpperCAmelCase             = """Hello, world. How are you?"""
												UpperCAmelCase             = tokenizer.tokenize(lowercase_					)
												self.assertEqual('[UNK]'   ,  tokens[0]					)

												UpperCAmelCase             = AutoTokenizer.from_pretrained('microsoft/mpnet-base'   ,  do_lower_case=lowercase_					)
												UpperCAmelCase             = tokenizer.tokenize(lowercase_					)
												self.assertEqual('[UNK]'   ,  tokens[0]					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :int					)				->			Dict:
												UpperCAmelCase             = AutoTokenizer.from_pretrained('robot-test/dummy-tokenizer-fast-with-model-config'					)
												self.assertEqual(type(lowercase_					)   ,  lowercase_					)
												self.assertEqual(tokenizer.model_max_length   ,  5_12					)
												self.assertEqual(tokenizer.vocab_size   ,  3_00_00					)
												self.assertEqual(tokenizer.unk_token   ,  '[UNK]'					)
												self.assertEqual(tokenizer.padding_side   ,  'right'					)
												self.assertEqual(tokenizer.truncation_side   ,  'right'					)






						def 	UpperCAmelCase__     (					self :str					)				->			Optional[Any]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
												self.assertIsInstance(lowercase_   ,  (BertTokenizer, BertTokenizerFast)					)
												with tempfile.TemporaryDirectory() as tmp_dir:
																		tokenizer.save_pretrained(lowercase_					)
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)

												self.assertIsInstance(lowercase_   ,  tokenizer.__class__					)
												self.assertEqual(tokenizera.vocab_size   ,  12					)






						def 	UpperCAmelCase__     (					self :Tuple					)				->			List[str]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained('ctrl'					)
												# There is no fast CTRL so this always gives us a slow tokenizer.
												self.assertIsInstance(lowercase_   ,  lowercase_					)






						def 	UpperCAmelCase__     (					self :Union[str, Any]					)				->			str:
												# Check we can load the tokenizer config of an online model.
												UpperCAmelCase             = get_tokenizer_config('bert-base-cased'					)
												UpperCAmelCase             = config.pop('_commit_hash'   ,  lowercase_					)
												# If we ever update bert-base-cased tokenizer config, this dict here will need to be updated.
												self.assertEqual(lowercase_   ,  {'do_lower_case': False}					)

												# This model does not have a tokenizer_config so we get back an empty dict.
												UpperCAmelCase             = get_tokenizer_config(lowercase_					)
												self.assertDictEqual(lowercase_   ,  {}					)

												# A tokenizer saved with `save_pretrained` always creates a tokenizer config.
												UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
												with tempfile.TemporaryDirectory() as tmp_dir:
																		tokenizer.save_pretrained(lowercase_					)
																		UpperCAmelCase             = get_tokenizer_config(lowercase_					)

												# Check the class of the tokenizer was properly saved (note that it always saves the slow class).
												self.assertEqual(config['tokenizer_class']   ,  'BertTokenizer'					)






						def 	UpperCAmelCase__     (					self :List[str]					)				->			Tuple:
												try:
																		AutoConfig.register('custom'   ,  lowercase_					)

																		AutoTokenizer.register(lowercase_   ,  slow_tokenizer_class=lowercase_					)
																		# Trying to register something existing in the Transformers library will raise an error
																		with self.assertRaises(lowercase_					):
																								AutoTokenizer.register(lowercase_   ,  slow_tokenizer_class=lowercase_					)

																		UpperCAmelCase             = CustomTokenizer.from_pretrained(lowercase_					)
																		with tempfile.TemporaryDirectory() as tmp_dir:
																								tokenizer.save_pretrained(lowercase_					)

																								UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
																								self.assertIsInstance(lowercase_   ,  lowercase_					)

												finally:
																		if "custom" in CONFIG_MAPPING._extra_content:
																								del CONFIG_MAPPING._extra_content["custom"]
																		if CustomConfig in TOKENIZER_MAPPING._extra_content:
																								del TOKENIZER_MAPPING._extra_content[CustomConfig]






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :Tuple					)				->			Dict:
												try:
																		AutoConfig.register('custom'   ,  lowercase_					)

																		# Can register in two steps
																		AutoTokenizer.register(lowercase_   ,  slow_tokenizer_class=lowercase_					)
																		self.assertEqual(TOKENIZER_MAPPING[CustomConfig]   ,  (CustomTokenizer, None)					)
																		AutoTokenizer.register(lowercase_   ,  fast_tokenizer_class=lowercase_					)
																		self.assertEqual(TOKENIZER_MAPPING[CustomConfig]   ,  (CustomTokenizer, CustomTokenizerFast)					)

																		del TOKENIZER_MAPPING._extra_content[CustomConfig]
																		# Can register in one step
																		AutoTokenizer.register(
																		    lowercase_   ,  slow_tokenizer_class=lowercase_   ,  fast_tokenizer_class=lowercase_					)
																		self.assertEqual(TOKENIZER_MAPPING[CustomConfig]   ,  (CustomTokenizer, CustomTokenizerFast)					)

																		# Trying to register something existing in the Transformers library will raise an error
																		with self.assertRaises(lowercase_					):
																								AutoTokenizer.register(lowercase_   ,  fast_tokenizer_class=lowercase_					)

																		# We pass through a bert tokenizer fast cause there is no converter slow to fast for our new toknizer
																		# and that model does not have a tokenizer.json
																		with tempfile.TemporaryDirectory() as tmp_dir:
																								UpperCAmelCase             = BertTokenizerFast.from_pretrained(lowercase_					)
																								bert_tokenizer.save_pretrained(lowercase_					)
																								UpperCAmelCase             = CustomTokenizerFast.from_pretrained(lowercase_					)

																		with tempfile.TemporaryDirectory() as tmp_dir:
																								tokenizer.save_pretrained(lowercase_					)

																								UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_					)
																								self.assertIsInstance(lowercase_   ,  lowercase_					)

																								UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  use_fast=lowercase_					)
																								self.assertIsInstance(lowercase_   ,  lowercase_					)

												finally:
																		if "custom" in CONFIG_MAPPING._extra_content:
																								del CONFIG_MAPPING._extra_content["custom"]
																		if CustomConfig in TOKENIZER_MAPPING._extra_content:
																								del TOKENIZER_MAPPING._extra_content[CustomConfig]






						def 	UpperCAmelCase__     (					self :int					)				->			str:
												# If remote code is not set, we will time out when asking whether to load the model.
												with self.assertRaises(lowercase_					):
																		UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/test_dynamic_tokenizer'					)
												# If remote code is disabled, we can't load this config.
												with self.assertRaises(lowercase_					):
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_					)

												UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_					)
												self.assertTrue(tokenizer.special_attribute_present					)
												# Test tokenizer can be reloaded.
												with tempfile.TemporaryDirectory() as tmp_dir:
																		tokenizer.save_pretrained(lowercase_					)
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  trust_remote_code=lowercase_					)
												self.assertTrue(reloaded_tokenizer.special_attribute_present					)

												if is_tokenizers_available():
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)
																		self.assertEqual(reloaded_tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)

																		# Test we can also load the slow version
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_   ,  use_fast=lowercase_					)
																		self.assertTrue(tokenizer.special_attribute_present					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		# Test tokenizer can be reloaded.
																		with tempfile.TemporaryDirectory() as tmp_dir:
																								tokenizer.save_pretrained(lowercase_					)
																								UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  trust_remote_code=lowercase_   ,  use_fast=lowercase_					)
																		self.assertEqual(reloaded_tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		self.assertTrue(reloaded_tokenizer.special_attribute_present					)
												else:
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		self.assertEqual(reloaded_tokenizer.__class__.__name__   ,  'NewTokenizer'					)






						@require_tokenizers
						def 	UpperCAmelCase__     (					self :List[Any]					)				->			List[str]:







												class       A_			(     __SCREAMING_SNAKE_CASE				):



																		"""simple docstring"""
																		__UpperCamelCase						=							False







												class       A_			(     __SCREAMING_SNAKE_CASE				):



																		"""simple docstring"""
																		__UpperCamelCase						=							NewTokenizer
																		__UpperCamelCase						=							False

												try:
																		AutoConfig.register('custom'   ,  lowercase_					)
																		AutoTokenizer.register(lowercase_   ,  slow_tokenizer_class=lowercase_					)
																		AutoTokenizer.register(lowercase_   ,  fast_tokenizer_class=lowercase_					)
																		# If remote code is not set, the default is to use local
																		UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/test_dynamic_tokenizer'					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)
																		self.assertFalse(tokenizer.special_attribute_present					)
																		UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/test_dynamic_tokenizer'   ,  use_fast=lowercase_					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		self.assertFalse(tokenizer.special_attribute_present					)

																		# If remote code is disabled, we load the local one.
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)
																		self.assertFalse(tokenizer.special_attribute_present					)
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_   ,  use_fast=lowercase_					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		self.assertFalse(tokenizer.special_attribute_present					)

																		# If remote is enabled, we load from the Hub
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)
																		self.assertTrue(tokenizer.special_attribute_present					)
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer'   ,  trust_remote_code=lowercase_   ,  use_fast=lowercase_					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
																		self.assertTrue(tokenizer.special_attribute_present					)

												finally:
																		if "custom" in CONFIG_MAPPING._extra_content:
																								del CONFIG_MAPPING._extra_content["custom"]
																		if CustomConfig in TOKENIZER_MAPPING._extra_content:
																								del TOKENIZER_MAPPING._extra_content[CustomConfig]






						def 	UpperCAmelCase__     (					self :Any					)				->			Optional[Any]:
												UpperCAmelCase             = AutoTokenizer.from_pretrained(
												    'hf-internal-testing/test_dynamic_tokenizer_legacy'   ,  trust_remote_code=lowercase_					)
												self.assertTrue(tokenizer.special_attribute_present					)
												if is_tokenizers_available():
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizerFast'					)

																		# Test we can also load the slow version
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(
																		    'hf-internal-testing/test_dynamic_tokenizer_legacy'   ,  trust_remote_code=lowercase_   ,  use_fast=lowercase_					)
																		self.assertTrue(tokenizer.special_attribute_present					)
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)
												else:
																		self.assertEqual(tokenizer.__class__.__name__   ,  'NewTokenizer'					)






						def 	UpperCAmelCase__     (					self :Any					)				->			Union[str, Any]:
												with self.assertRaisesRegex(
												    lowercase_   ,  'bert-base is not a local folder and is not a valid model identifier'					):
																		UpperCAmelCase             = AutoTokenizer.from_pretrained('bert-base'					)






						def 	UpperCAmelCase__     (					self :List[Any]					)				->			Union[str, Any]:
												with self.assertRaisesRegex(
												    lowercase_   ,  R'aaaaaa is not a valid git identifier \(branch name, tag name or commit id\)'					):
																		UpperCAmelCase             = AutoTokenizer.from_pretrained(lowercase_   ,  revision='aaaaaa'					)






						def 	UpperCAmelCase__     (					self :str					)				->			Dict:
												# Make sure we have cached the tokenizer.
												UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/tiny-random-bert'					)
												with RequestCounter() as counter:
																		UpperCAmelCase             = AutoTokenizer.from_pretrained('hf-internal-testing/tiny-random-bert'					)
																		self.assertEqual(counter.get_request_count   ,  0					)
																		self.assertEqual(counter.head_request_count   ,  1					)
																		self.assertEqual(counter.other_request_count   ,  0					)







import warnings
from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_lowerCamelCase					   =logging.get_logger(__name__)

_lowerCamelCase					   ={
    """nvidia/segformer-b0-finetuned-ade-512-512""": (
        """https://huggingface.co/nvidia/segformer-b0-finetuned-ade-512-512/resolve/main/config.json"""
    ),
    # See all SegFormer models at https://huggingface.co/models?filter=segformer
}





class 							A__		(	__SCREAMING_SNAKE_CASE):
      _UpperCAmelCase				:    Dict           =			"""segformer"""
      def __init__(      self    ,  __magic_name__=3    ,  __magic_name__=4    ,  __magic_name__=[2, 2, 2, 2]    ,  __magic_name__=[8, 4, 2, 1]    ,  __magic_name__=[3_2, 6_4, 1_6_0, 2_5_6]    ,  __magic_name__=[7, 3, 3, 3]    ,  __magic_name__=[4, 2, 2, 2]    ,  __magic_name__=[1, 2, 5, 8]    ,  __magic_name__=[4, 4, 4, 4]    ,  __magic_name__="gelu"    ,  __magic_name__=0.0    ,  __magic_name__=0.0    ,  __magic_name__=0.1    ,  __magic_name__=0.02    ,  __magic_name__=0.1    ,  __magic_name__=1e-6    ,  __magic_name__=2_5_6    ,  __magic_name__=2_5_5    ,  **__magic_name__    ,  ):
       super().__init__(**__magic_name__      )

       if "reshape_last_stage" in kwargs and kwargs["reshape_last_stage"] is False:
        warnings.warn(
            """Reshape_last_stage is set to False in this config. This argument is deprecated and will soon be"""
            """ removed, as the behaviour will default to that of reshape_last_stage = True."""    ,  __magic_name__    ,  )

       lowerCamelCase		:	Optional[Any]							=      num_channels
       lowerCamelCase		:	str							=      num_encoder_blocks
       lowerCamelCase		:	Any							=      depths
       lowerCamelCase		:	List[Any]							=      sr_ratios
       lowerCamelCase		:	int							=      hidden_sizes
       lowerCamelCase		:	Union[str, Any]							=      patch_sizes
       lowerCamelCase		:	Optional[Any]							=      strides
       lowerCamelCase		:	Dict							=      mlp_ratios
       lowerCamelCase		:	str							=      num_attention_heads
       lowerCamelCase		:	Any							=      hidden_act
       lowerCamelCase		:	Tuple							=      hidden_dropout_prob
       lowerCamelCase		:	Union[str, Any]							=      attention_probs_dropout_prob
       lowerCamelCase		:	Dict							=      classifier_dropout_prob
       lowerCamelCase		:	Tuple							=      initializer_range
       lowerCamelCase		:	Dict							=      drop_path_rate
       lowerCamelCase		:	List[str]							=      layer_norm_eps
       lowerCamelCase		:	Any							=      decoder_hidden_size
       lowerCamelCase		:	str							=      kwargs.get("""reshape_last_stage"""    ,  __magic_name__      )
       lowerCamelCase		:	Dict							=      semantic_loss_ignore_index





class 							A__		(	__SCREAMING_SNAKE_CASE):
      _UpperCAmelCase				:    str           =			version.parse("""1.11""")
      @property
      def 						UpperCamelCase__							(      self      ):
       return OrderedDict(
           [
               ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
           ]      )
      @property
      def 						UpperCamelCase__							(      self      ):
       return 1e-4






      @property
      def 						UpperCamelCase__							(      self      ):
       return 1_2




