





import inspect
import unittest

from transformers import ConvNextVaConfig
from transformers.models.auto import get_values
from transformers.models.auto.modeling_auto import MODEL_FOR_BACKBONE_MAPPING_NAMES, MODEL_MAPPING_NAMES
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers import ConvNextVaBackbone, ConvNextVaForImageClassification, ConvNextVaModel
					from transformers.models.convnextva.modeling_convnextva import CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
					from PIL import Image

					from transformers import AutoImageProcessor


class   A      :
			'''simple docstring'''




			def __init__(      self       :   Optional[Any]							,     __lowerCAmelCase       :   Optional[int]							,     __lowerCAmelCase       :   Optional[int]=13							,     __lowerCAmelCase       :   List[str]=32							,     __lowerCAmelCase       :   List[Any]=3							,     __lowerCAmelCase       :   Union[str, Any]=4							,     __lowerCAmelCase       :   Any=[10, 20, 30, 40]							,     __lowerCAmelCase       :   Dict=[2, 2, 3, 2]							,     __lowerCAmelCase       :   Dict=True							,     __lowerCAmelCase       :   Optional[Any]=True							,     __lowerCAmelCase       :   Optional[int]=37							,     __lowerCAmelCase       :   Union[str, Any]="gelu"							,     __lowerCAmelCase       :   int=10							,     __lowerCAmelCase       :   List[str]=0.0_2							,     __lowerCAmelCase       :   Union[str, Any]=["stage2", "stage3", "stage4"]							,     __lowerCAmelCase       :   Optional[int]=[2, 3, 4]							,     __lowerCAmelCase       :   List[Any]=None							,     )     ->     Dict:







					"""simple docstring"""






					A__  				=       parent
					A__  				=       batch_size
					A__  				=       image_size
					A__  				=       num_channels
					A__  				=       num_stages
					A__  				=       hidden_sizes
					A__  				=       depths
					A__  				=       is_training
					A__  				=       use_labels
					A__  				=       intermediate_size
					A__  				=       hidden_act
					A__  				=       num_labels
					A__  				=       initializer_range
					A__  				=       out_features
					A__  				=       out_indices
					A__  				=       scope






			def        a_	(      self       :   Dict       )     ->     Tuple:







					"""simple docstring"""






					A__  				=       floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]       )

					A__  				=       None
					if self.use_labels:
							A__  				=       ids_tensor([self.batch_size]							,     self.num_labels       )

					A__  				=       self.get_config()

					return config, pixel_values, labels






			def        a_	(      self       :   Union[str, Any]       )     ->     Dict:







					"""simple docstring"""






					return ConvNextVaConfig(
					    num_channels=self.num_channels							,     hidden_sizes=self.hidden_sizes							,     depths=self.depths							,     num_stages=self.num_stages							,     hidden_act=self.hidden_act							,     is_decoder=__lowerCAmelCase							,     initializer_range=self.initializer_range							,     out_features=self.out_features							,     out_indices=self.out_indices							,     num_labels=self.num_labels							,     )






			def        a_	(      self       :   Any							,     __lowerCAmelCase       :   str							,     __lowerCAmelCase       :   Any							,     __lowerCAmelCase       :   Optional[Any]       )     ->     str:







					"""simple docstring"""






					A__  				=       ConvNextVaModel(config=__lowerCAmelCase       )
					model.to(__lowerCAmelCase       )
					model.eval()
					A__  				=       model(__lowerCAmelCase       )
					# expected last hidden states: B, C, H // 32, W // 32
					self.parent.assertEqual(
					    result.last_hidden_state.shape							,     (self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)							,     )






			def        a_	(      self       :   List[Any]							,     __lowerCAmelCase       :   List[Any]							,     __lowerCAmelCase       :   List[str]							,     __lowerCAmelCase       :   Tuple       )     ->     str:







					"""simple docstring"""






					A__  				=       ConvNextVaForImageClassification(__lowerCAmelCase       )
					model.to(__lowerCAmelCase       )
					model.eval()
					A__  				=       model(__lowerCAmelCase							,     labels=__lowerCAmelCase       )
					self.parent.assertEqual(result.logits.shape							,     (self.batch_size, self.num_labels)       )






			def        a_	(      self       :   List[Any]							,     __lowerCAmelCase       :   List[Any]							,     __lowerCAmelCase       :   List[str]							,     __lowerCAmelCase       :   Dict       )     ->     Optional[Any]:







					"""simple docstring"""






					A__  				=       ConvNextVaBackbone(config=__lowerCAmelCase       )
					model.to(__lowerCAmelCase       )
					model.eval()
					A__  				=       model(__lowerCAmelCase       )

					# verify hidden states
					self.parent.assertEqual(len(result.feature_maps       )							,     len(config.out_features       )       )
					self.parent.assertListEqual(list(result.feature_maps[0].shape       )							,     [self.batch_size, self.hidden_sizes[1], 4, 4]       )

					# verify channels
					self.parent.assertEqual(len(model.channels       )							,     len(config.out_features       )       )
					self.parent.assertListEqual(model.channels							,     config.hidden_sizes[1:]       )

					# verify backbone works with out_features=None
					A__  				=       None
					A__  				=       ConvNextVaBackbone(config=__lowerCAmelCase       )
					model.to(__lowerCAmelCase       )
					model.eval()
					A__  				=       model(__lowerCAmelCase       )

					# verify feature maps
					self.parent.assertEqual(len(result.feature_maps       )							,     1       )
					self.parent.assertListEqual(list(result.feature_maps[0].shape       )							,     [self.batch_size, self.hidden_sizes[-1], 1, 1]       )

					# verify channels
					self.parent.assertEqual(len(model.channels       )							,     1       )
					self.parent.assertListEqual(model.channels							,     [config.hidden_sizes[-1]]       )






			def        a_	(      self       :   int       )     ->     List[Any]:







					"""simple docstring"""






					A__  				=       self.prepare_config_and_inputs()
					A__				,      A__				,      A__  				=       config_and_inputs
					A__  				=       {"""pixel_values""": pixel_values}
					return config, inputs_dict







			def        a_	(      self       :   List[Any]       )     ->     Optional[int]:







					"""simple docstring"""






					A__  				=       self.prepare_config_and_inputs()
					A__				,      A__				,      A__  				=       config_and_inputs
					A__  				=       {"""pixel_values""": pixel_values, """labels""": labels}
					return config, inputs_dict


@require_torch
class   A      (SCREAMING_SNAKE_CASE       ,					SCREAMING_SNAKE_CASE       ,					unittest.TestCase   ):
			'''simple docstring'''




			__lowerCamelCase     :	Optional[int]          =   (
			    (
			        ConvNextVaModel,
			        ConvNextVaForImageClassification,
			        ConvNextVaBackbone,
			    )
			    if is_torch_available()
			    else ()
			)
			__lowerCamelCase     :	List[str]          =   (
			    {'''feature-extraction''': ConvNextVaModel, '''image-classification''': ConvNextVaForImageClassification}
			    if is_torch_available()
			    else {}
			)

			__lowerCamelCase     :	Dict          =   False
			__lowerCamelCase     :	int          =   False
			__lowerCamelCase     :	Optional[int]          =   False
			__lowerCamelCase     :	Dict          =   False
			__lowerCamelCase     :	Optional[Any]          =   False






			def        a_	(      self       :   Union[str, Any]       )     ->     Tuple:







					"""simple docstring"""






					A__  				=       ConvNextVaModelTester(self       )
					A__  				=       ConfigTester(self							,     config_class=__lowerCAmelCase							,     has_text_modality=__lowerCAmelCase							,     hidden_size=37       )






			def        a_	(      self       :   Optional[int]       )     ->     Tuple:







					"""simple docstring"""






					self.create_and_test_config_common_properties()
					self.config_tester.create_and_test_config_to_json_string()
					self.config_tester.create_and_test_config_to_json_file()
					self.config_tester.create_and_test_config_from_and_save_pretrained()
					self.config_tester.create_and_test_config_with_num_labels()
					self.config_tester.check_config_can_be_init_without_params()
					self.config_tester.check_config_arguments_init()






			def        a_	(      self       :   int       )     ->     int:







					"""simple docstring"""






					return






			@unittest.skip(reason="""ConvNextV2 does not use inputs_embeds"""       )
			def        a_	(      self       :   Any       )     ->     str:







					"""simple docstring"""






					pass






			@unittest.skip(reason="""ConvNextV2 does not support input and output embeddings"""       )
			def        a_	(      self       :   List[Any]       )     ->     Any:







					"""simple docstring"""






					pass






			@unittest.skip(reason="""ConvNextV2 does not use feedforward chunking"""       )
			def        a_	(      self       :   Optional[int]       )     ->     Any:







					"""simple docstring"""






					pass






			def        a_	(      self       :   Dict       )     ->     Any:







					"""simple docstring"""






					if not self.model_tester.is_training:
							return

					for model_class in self.all_model_classes:
							A__				,      A__  				=       self.model_tester.prepare_config_and_inputs_with_labels()
							A__  				=       True

							if model_class.__name__ in [
							    *get_values(__lowerCAmelCase       ),
							    *get_values(__lowerCAmelCase       ),
							]:
									continue

							A__  				=       model_class(__lowerCAmelCase       )
							model.to(__lowerCAmelCase       )
							model.train()
							A__  				=       self._prepare_for_class(__lowerCAmelCase							,     __lowerCAmelCase							,     return_labels=__lowerCAmelCase       )
							A__  				=       model(**__lowerCAmelCase       ).loss
							loss.backward()






			def        a_	(      self       :   Optional[int]       )     ->     Dict:







					"""simple docstring"""






					if not self.model_tester.is_training:
							return

					for model_class in self.all_model_classes:
							A__				,      A__  				=       self.model_tester.prepare_config_and_inputs_with_labels()
							A__  				=       False
							A__  				=       True

							if (
							    model_class.__name__
							    in [*get_values(__lowerCAmelCase       ), *get_values(__lowerCAmelCase       )]
							    or not model_class.supports_gradient_checkpointing
							):
									continue

							A__  				=       model_class(__lowerCAmelCase       )
							model.to(__lowerCAmelCase       )
							model.gradient_checkpointing_enable()
							model.train()
							A__  				=       self._prepare_for_class(__lowerCAmelCase							,     __lowerCAmelCase							,     return_labels=__lowerCAmelCase       )
							A__  				=       model(**__lowerCAmelCase       ).loss
							loss.backward()






			def        a_	(      self       :   List[Any]       )     ->     int:







					"""simple docstring"""






					A__				,      A__  				=       self.model_tester.prepare_config_and_inputs_for_common()

					for model_class in self.all_model_classes:
							A__  				=       model_class(__lowerCAmelCase       )
							A__  				=       inspect.signature(model.forward       )
							# signature.parameters is an OrderedDict => so arg_names order is deterministic
							A__  				=       [*signature.parameters.keys()]

							A__  				=       ["""pixel_values"""]
							self.assertListEqual(arg_names[:1]							,     __lowerCAmelCase       )






			def        a_	(      self       :   Optional[Any]       )     ->     Dict:







					"""simple docstring"""






					A__  				=       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_model(*__lowerCAmelCase       )






			def        a_	(      self       :   Optional[int]       )     ->     Dict:







					"""simple docstring"""






					def check_hidden_states_output(__lowerCAmelCase       :   Union[str, Any]							,     __lowerCAmelCase       :   List[Any]							,     __lowerCAmelCase       :   Optional[Any]       ):
							A__  				=       model_class(__lowerCAmelCase       )
							model.to(__lowerCAmelCase       )
							model.eval()

							with torch.no_grad():
									A__  				=       model(**self._prepare_for_class(__lowerCAmelCase							,     __lowerCAmelCase       )       )

							A__  				=       outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

							A__  				=       self.model_tester.num_stages
							self.assertEqual(len(__lowerCAmelCase       )							,     expected_num_stages + 1       )

							# ConvNextV2's feature maps are of shape (batch_size, num_channels, height, width)
							self.assertListEqual(
							    list(hidden_states[0].shape[-2:]       )							,     [self.model_tester.image_size // 4, self.model_tester.image_size // 4]							,     )

					A__				,      A__  				=       self.model_tester.prepare_config_and_inputs_for_common()

					for model_class in self.all_model_classes:
							A__  				=       True
							check_hidden_states_output(__lowerCAmelCase							,     __lowerCAmelCase							,     __lowerCAmelCase       )

							# check that output_hidden_states also work using config
							del inputs_dict["output_hidden_states"]
							A__  				=       True

							check_hidden_states_output(__lowerCAmelCase							,     __lowerCAmelCase							,     __lowerCAmelCase       )






			def        a_	(      self       :   Union[str, Any]       )     ->     List[str]:







					"""simple docstring"""






					A__  				=       self.model_tester.prepare_config_and_inputs()
					self.model_tester.create_and_check_for_image_classification(*__lowerCAmelCase       )







			@slow
			def        a_	(      self       :   Tuple       )     ->     List[str]:







					"""simple docstring"""






					for model_name in CONVNEXTV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
							A__  				=       ConvNextVaModel.from_pretrained(__lowerCAmelCase       )
							self.assertIsNotNone(__lowerCAmelCase       )







def        __lowerCamelCase (							)		->    str:






		"""simple docstring"""

		A__  				=       Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""   )
		return image






@require_torch
@require_vision
class   A      (unittest.TestCase   ):
			'''simple docstring'''




			@cached_property
			def        a_	(      self       :   Union[str, Any]       )     ->     Any:







					"""simple docstring"""






					return AutoImageProcessor.from_pretrained("""facebook/convnextv2-tiny-1k-224"""       ) if is_vision_available() else None







			@slow
			def        a_	(      self       :   str       )     ->     Tuple:







					"""simple docstring"""






					A__  				=       ConvNextVaForImageClassification.from_pretrained("""facebook/convnextv2-tiny-1k-224"""       ).to(__lowerCAmelCase       )

					A__  				=       self.default_image_processor
					A__  				=       prepare_img()
					A__  				=       preprocessor(images=__lowerCAmelCase							,     return_tensors="""pt"""       ).to(__lowerCAmelCase       )

					# forward pass
					with torch.no_grad():
							A__  				=       model(**__lowerCAmelCase       )

					# verify the logits
					A__  				=       torch.Size((1, 10_00)       )
					self.assertEqual(outputs.logits.shape							,     __lowerCAmelCase       )

					A__  				=       torch.tensor([0.9_9_9_6, 0.1_9_6_6, -0.4_3_8_6]       ).to(__lowerCAmelCase       )
					self.assertTrue(torch.allclose(outputs.logits[0, :3]							,     __lowerCAmelCase							,     atol=1e-4       )       )










import os
import re
import shutil
import sys
import tempfile
import unittest

import black


A   : Dict			=				os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, '''utils'''))

import check_copies  # noqa: E402


# This is the reference code that will be used in the tests.
# If BertLMPredictionHead is changed in modeling_bert.py, this code needs to be manually updated.
A   : Optional[int]			=				'''    def __init__(self, config):
        super().__init__()
        self.transform = BertPredictionHeadTransform(config)

        # The output weights are the same as the input embeddings, but there is
        # an output-only bias for each token.
        self.decoder = nn.Linear(config.hidden_size, config.vocab_size, bias=False)

        self.bias = nn.Parameter(torch.zeros(config.vocab_size))

        # Need a link between the two variables so that the bias is correctly resized with `resize_token_embeddings`
        self.decoder.bias = self.bias

    def forward(self, hidden_states):
        hidden_states = self.transform(hidden_states)
        hidden_states = self.decoder(hidden_states)
        return hidden_states
'''


class   A      (unittest.TestCase   ):
			'''simple docstring'''




			def        a_	(      self       :   Union[str, Any]       )     ->     List[str]:







					"""simple docstring"""






					A__  				=       tempfile.mkdtemp()
					os.makedirs(os.path.join(self.transformer_dir							,     """models/bert/"""       )       )
					A__  				=       self.transformer_dir
					shutil.copy(
					    os.path.join(__lowerCAmelCase							,     """src/transformers/models/bert/modeling_bert.py"""       )							,     os.path.join(self.transformer_dir							,     """models/bert/modeling_bert.py"""       )							,     )






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







					"""simple docstring"""






					A__  				=       """src/transformers"""
					shutil.rmtree(self.transformer_dir       )






			def        a_	(      self       :   List[str]							,     __lowerCAmelCase       :   List[Any]							,     __lowerCAmelCase       :   Optional[int]							,     __lowerCAmelCase       :   int							,     __lowerCAmelCase       :   Tuple=None       )     ->     Dict:







					"""simple docstring"""






					A__  				=       comment + f'\nclass {class_name}(nn.Module):\n' + class_code
					if overwrite_result is not None:
							A__  				=       comment + f'\nclass {class_name}(nn.Module):\n' + overwrite_result
					A__  				=       black.Mode(target_versions={black.TargetVersion.PYaa}							,     line_length=1_19       )
					A__  				=       black.format_str(__lowerCAmelCase							,     mode=__lowerCAmelCase       )
					A__  				=       os.path.join(self.transformer_dir							,     """new_code.py"""       )
					with open(__lowerCAmelCase							,     """w"""							,     newline="""\n"""       ) as f:
							f.write(__lowerCAmelCase       )
					if overwrite_result is None:
							self.assertTrue(len(check_copies.is_copy_consistent(__lowerCAmelCase       )       ) == 0       )
					else:
							check_copies.is_copy_consistent(f.name							,     overwrite=__lowerCAmelCase       )
							with open(__lowerCAmelCase							,     """r"""       ) as f:
									self.assertTrue(f.read()							,     __lowerCAmelCase       )






			def        a_	(      self       :   Tuple       )     ->     List[Any]:







					"""simple docstring"""






					A__  				=       check_copies.find_code_in_transformers("""models.bert.modeling_bert.BertLMPredictionHead"""       )
					self.assertEqual(__lowerCAmelCase							,     __lowerCAmelCase       )






			def        a_	(      self       :   Tuple       )     ->     Any:







					"""simple docstring"""






					self.check_copy_consistency(
					    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead"""							,     """BertLMPredictionHead"""							,     REFERENCE_CODE + """\n"""							,     )

					# With no empty line at the end
					self.check_copy_consistency(
					    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead"""							,     """BertLMPredictionHead"""							,     __lowerCAmelCase							,     )

					# Copy consistency with rename
					self.check_copy_consistency(
					    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->TestModel"""							,     """TestModelLMPredictionHead"""							,     re.sub("""Bert"""							,     """TestModel"""							,     __lowerCAmelCase       )							,     )

					# Copy consistency with a really long name
					A__  				=       """TestModelWithAReallyLongNameBecauseSomePeopleLikeThatForSomeReason"""
					self.check_copy_consistency(
					    f'# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->{long_class_name}'							,     f'{long_class_name}LMPredictionHead'							,     re.sub("""Bert"""							,     __lowerCAmelCase							,     __lowerCAmelCase       )							,     )

					# Copy consistency with overwrite
					self.check_copy_consistency(
					    """# Copied from transformers.models.bert.modeling_bert.BertLMPredictionHead with Bert->TestModel"""							,     """TestModelLMPredictionHead"""							,     __lowerCAmelCase							,     overwrite_result=re.sub("""Bert"""							,     """TestModel"""							,     __lowerCAmelCase       )							,     )







			def        a_	(      self       :   Optional[int]       )     ->     Optional[int]:







					"""simple docstring"""






					A__  				=       check_copies.LOCALIZED_READMES["""README_zh-hans.md"""]

					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (from Google Research and the"""
					    """ Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for"""
					    """ Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong"""
					    """ Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut.\n1."""
					    """ **[DistilBERT](https://huggingface.co/transformers/model_doc/distilbert.html)** (from HuggingFace),"""
					    """ released together with the paper [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and"""
					    """ lighter](https://arxiv.org/abs/1910.01108) by Victor Sanh, Lysandre Debut and Thomas Wolf. The same"""
					    """ method has been applied to compress GPT2 into"""
					    """ [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/distillation), RoBERTa into"""
					    """ [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/distillation),"""
					    """ Multilingual BERT into"""
					    """ [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/distillation) and a German"""
					    """ version of DistilBERT.\n1. **[ELECTRA](https://huggingface.co/transformers/model_doc/electra.html)**"""
					    """ (from Google Research/Stanford University) released with the paper [ELECTRA: Pre-training text encoders"""
					    """ as discriminators rather than generators](https://arxiv.org/abs/2003.10555) by Kevin Clark, Minh-Thang"""
					    """ Luong, Quoc V. Le, Christopher D. Manning."""
					)
					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
					    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
					    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
					    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
					)
					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
					    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
					    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
					    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n1."""
					    """ **[DistilBERT](https://huggingface.co/transformers/model_doc/distilbert.html)** (来自 HuggingFace) 伴随论文"""
					    """ [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and"""
					    """ lighter](https://arxiv.org/abs/1910.01108) 由 Victor Sanh, Lysandre Debut and Thomas Wolf 发布。 The same"""
					    """ method has been applied to compress GPT2 into"""
					    """ [DistilGPT2](https://github.com/huggingface/transformers/tree/main/examples/distillation), RoBERTa into"""
					    """ [DistilRoBERTa](https://github.com/huggingface/transformers/tree/main/examples/distillation),"""
					    """ Multilingual BERT into"""
					    """ [DistilmBERT](https://github.com/huggingface/transformers/tree/main/examples/distillation) and a German"""
					    """ version of DistilBERT.\n1. **[ELECTRA](https://huggingface.co/transformers/model_doc/electra.html)** (来自"""
					    """ Google Research/Stanford University) 伴随论文 [ELECTRA: Pre-training text encoders as discriminators rather"""
					    """ than generators](https://arxiv.org/abs/2003.10555) 由 Kevin Clark, Minh-Thang Luong, Quoc V. Le,"""
					    """ Christopher D. Manning 发布。\n"""
					)

					A__				,      A__  				=       check_copies.convert_to_localized_md(
					    __lowerCAmelCase							,     __lowerCAmelCase							,     localized_readme["""format_model_list"""]       )

					self.assertFalse(__lowerCAmelCase       )
					self.assertEqual(__lowerCAmelCase							,     __lowerCAmelCase       )

					A__				,      A__  				=       check_copies.convert_to_localized_md(
					    __lowerCAmelCase							,     __lowerCAmelCase							,     localized_readme["""format_model_list"""]       )

					# Check whether the number of models is equal to README.md after conversion.
					self.assertTrue(__lowerCAmelCase       )

					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (from Google Research and the"""
					    """ Toyota Technological Institute at Chicago) released with the paper [ALBERT: A Lite BERT for"""
					    """ Self-supervised Learning of Language Representations](https://arxiv.org/abs/1909.11942), by Zhenzhong"""
					    """ Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut."""
					)
					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/main/model_doc/albert.html)** (来自 Google Research and"""
					    """ the Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
					    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
					    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
					)
					A__  				=       (
					    """1. **[ALBERT](https://huggingface.co/transformers/model_doc/albert.html)** (来自 Google Research and the"""
					    """ Toyota Technological Institute at Chicago) 伴随论文 [ALBERT: A Lite BERT for Self-supervised Learning of"""
					    """ Language Representations](https://arxiv.org/abs/1909.11942), 由 Zhenzhong Lan, Mingda Chen, Sebastian"""
					    """ Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut 发布。\n"""
					)

					A__				,      A__  				=       check_copies.convert_to_localized_md(
					    __lowerCAmelCase							,     __lowerCAmelCase							,     localized_readme["""format_model_list"""]       )

					# Check if the model link is synchronized.
					self.assertEqual(__lowerCAmelCase							,     __lowerCAmelCase       )



