




import collections.abc
from typing import Optional, Tuple, Union

import torch
import torch.utils.checkpoint
from torch import nn
from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss, MSELoss

from ...activations import ACTaFN
from ...modeling_outputs import BaseModelOutputWithNoAttention, ImageClassifierOutputWithNoAttention
from ...modeling_utils import PreTrainedModel
from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
from .configuration_poolformer import PoolFormerConfig


_snake_case            = logging.get_logger(__name__)

# General docstring
_snake_case            = "PoolFormerConfig"

# Base docstring
_snake_case            = "sail/poolformer_s12"
_snake_case            = [1, 512, 7, 7]

# Image classification docstring
_snake_case            = "sail/poolformer_s12"
_snake_case            = "tabby, tabby cat"

_snake_case            = [
    "sail/poolformer_s12",
    # See all PoolFormer models at https://huggingface.co/models?filter=poolformer
]







def        lowerCAmelCase_			(  snake_case_,snake_case_ = 0.0,snake_case_ = False  ):
     if drop_prob == 0.0 or not training:
          return input
     _A							:  List[str]    =		1 - drop_prob
     _A							:  Optional[int]    =		(input.shape[0],) + (1,) * (input.ndim - 1)  # work with diff dim tensors, not just 2D ConvNets
     _A							:  str    =		keep_prob + torch.rand(snake_case_,dtype=input.dtype,device=input.device  )
     random_tensor.floor_()  # binarize
     _A							:  List[str]    =		input.div(snake_case_  ) * random_tensor
     return output







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a = None       )		->							None:
          super().__init__()
          _A							:  List[str]    =		drop_prob

     def       a__			(						self	,  _a       )		->							torch.Tensor:
          return drop_path(_a	,  self.drop_prob	,  self.training       )



     def       a__			(						self       )		->							str:
          return "p={}".format(self.drop_prob       )







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a=None       )		->							List[str]:
          super().__init__()
          _A							:  int    =		patch_size if isinstance(_a	,  collections.abc.Iterable       ) else (patch_size, patch_size)
          _A							:  Optional[Any]    =		stride if isinstance(_a	,  collections.abc.Iterable       ) else (stride, stride)
          _A							:  Dict    =		padding if isinstance(_a	,  collections.abc.Iterable       ) else (padding, padding)

          _A							:  Optional[Any]    =		nn.Convad(_a	,  _a	,  kernel_size=_a	,  stride=_a	,  padding=_a       )
          _A							:  str    =		norm_layer(_a       ) if norm_layer else nn.Identity()



     def       a__			(						self	,  _a       )		->							List[Any]:
          _A							:  Any    =		self.projection(_a       )
          _A							:  List[Any]    =		self.norm(_a       )
          return embeddings







class 		lowercase							(     nn.GroupNorm	):

     def __init__(						self	,  _a	,  **_a       )		->							List[Any]:
          super().__init__(1	,  _a	,  **_a       )







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a       )		->							int:
          super().__init__()
          _A							:  Union[str, Any]    =		nn.AvgPoolad(_a	,  stride=1	,  padding=pool_size // 2	,  count_include_pad=_a       )



     def       a__			(						self	,  _a       )		->							Tuple:
          return self.pool(_a       ) - hidden_states







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a	,  _a	,  _a	,  _a       )		->							int:
          super().__init__()
          _A							:  Tuple    =		nn.Convad(_a	,  _a	,  1       )
          _A							:  Tuple    =		nn.Convad(_a	,  _a	,  1       )
          _A							:  Any    =		PoolFormerDropPath(_a       )
          if isinstance(config.hidden_act	,  _a       ):
               _A							:  Optional[int]    =		ACTaFN[config.hidden_act]
          else:
               _A							:  Optional[Any]    =		config.hidden_act



     def       a__			(						self	,  _a       )		->							Any:
          _A							:  Tuple    =		self.conva(_a       )
          _A							:  int    =		self.act_fn(_a       )
          _A							:  List[str]    =		self.drop(_a       )
          _A							:  Union[str, Any]    =		self.conva(_a       )
          _A							:  Optional[int]    =		self.drop(_a       )

          return hidden_states







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a	,  _a	,  _a	,  _a	,  _a	,  _a       )		->							Union[str, Any]:
          super().__init__()
          _A							:  List[str]    =		PoolFormerPooling(_a       )
          _A							:  int    =		PoolFormerOutput(_a	,  _a	,  _a	,  _a       )
          _A							:  Optional[Any]    =		PoolFormerGroupNorm(_a       )
          _A							:  Optional[Any]    =		PoolFormerGroupNorm(_a       )

          # Useful for training neural nets
          _A							:  List[Any]    =		PoolFormerDropPath(_a       ) if drop_path > 0.0 else nn.Identity()
          _A							:  List[str]    =		config.use_layer_scale
          if config.use_layer_scale:
               _A							:  Tuple    =		nn.Parameter(
                   config.layer_scale_init_value * torch.ones((_a)       )	,  requires_grad=_a       )
               _A							:  Tuple    =		nn.Parameter(
                   config.layer_scale_init_value * torch.ones((_a)       )	,  requires_grad=_a       )



     def       a__			(						self	,  _a       )		->							Union[str, Any]:
          if self.use_layer_scale:
               _A							:  Optional[Any]    =		self.pooling(self.before_norm(_a       )       )
               _A							:  Union[str, Any]    =		self.layer_scale_a.unsqueeze(-1       ).unsqueeze(-1       ) * pooling_output
               # First residual connection
               _A							:  Union[str, Any]    =		hidden_states + self.drop_path(_a       )
               _A							:  List[Any]    =		()

               _A							:  List[str]    =		self.output(self.after_norm(_a       )       )
               _A							:  Optional[Any]    =		self.layer_scale_a.unsqueeze(-1       ).unsqueeze(-1       ) * layer_output
               # Second residual connection
               _A							:  List[Any]    =		hidden_states + self.drop_path(_a       )

               _A							:  Union[str, Any]    =		(output,) + outputs
               return outputs

          else:
               _A							:  int    =		self.drop_path(self.pooling(self.before_norm(_a       )       )       )
               # First residual connection
               _A							:  int    =		pooling_output + hidden_states
               _A							:  Dict    =		()

               # Second residual connection inside the PoolFormerOutput block
               _A							:  int    =		self.drop_path(self.output(self.after_norm(_a       )       )       )
               _A							:  Union[str, Any]    =		hidden_states + layer_output

               _A							:  Dict    =		(output,) + outputs
               return outputs







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a       )		->							Optional[int]:
          super().__init__()
          _A							:  Union[str, Any]    =		config
          # stochastic depth decay rule
          _A							:  Union[str, Any]    =		[x.item() for x in torch.linspace(0	,  config.drop_path_rate	,  sum(config.depths       )       )]

          # patch embeddings
          _A							:  Optional[Any]    =		[]
          for i in range(config.num_encoder_blocks       ):
               embeddings.append(
                   PoolFormerEmbeddings(
                       patch_size=config.patch_sizes[i]	,  stride=config.strides[i]	,  padding=config.padding[i]	,  num_channels=config.num_channels if i == 0 else config.hidden_sizes[i - 1]	,  hidden_size=config.hidden_sizes[i]	,  )       )
          _A							:  Optional[int]    =		nn.ModuleList(_a       )

          # Transformer blocks
          _A							:  Optional[Any]    =		[]
          _A							:  Tuple    =		0
          for i in range(config.num_encoder_blocks       ):
               # each block consists of layers
               _A							:  List[Any]    =		[]
               if i != 0:
                    cur += config.depths[i - 1]
               for j in range(config.depths[i]       ):
                    layers.append(
                        PoolFormerLayer(
                            _a	,  num_channels=config.hidden_sizes[i]	,  pool_size=config.pool_size	,  hidden_size=config.hidden_sizes[i]	,  intermediate_size=int(config.hidden_sizes[i] * config.mlp_ratio       )	,  drop_path=dpr[cur + j]	,  )       )
               blocks.append(nn.ModuleList(_a       )       )

          _A							:  List[Any]    =		nn.ModuleList(_a       )



     def       a__			(						self	,  _a	,  _a=False	,  _a=True       )		->							Tuple:
          _A							:  Tuple    =		() if output_hidden_states else None

          _A							:  List[str]    =		pixel_values
          for idx, layers in enumerate(zip(self.patch_embeddings	,  self.block       )       ):
               _A							:  Union[str, Any]    =		layers
               # Get patch embeddings from hidden_states
               _A							:  str    =		embedding_layer(_a       )
               # Send the embeddings through the blocks
               for _, blk in enumerate(_a       ):
                    _A							:  Optional[Any]    =		blk(_a       )
                    _A							:  List[str]    =		layer_outputs[0]

               if output_hidden_states:
                    _A							:  Any    =		all_hidden_states + (hidden_states,)

          if not return_dict:
               return tuple(v for v in [hidden_states, all_hidden_states] if v is not None       )

          return BaseModelOutputWithNoAttention(last_hidden_state=_a	,  hidden_states=_a       )







class 		lowercase							(     UpperCamelCase__	):
     _a											=		PoolFormerConfig
     _a											=		"poolformer"
     _a											=		"pixel_values"
     _a											=		True

     def       a__			(						self	,  _a       )		->							Tuple:
          if isinstance(_a	,  (nn.Linear, nn.Convad)       ):
               module.weight.data.normal_(mean=0.0	,  std=self.config.initializer_range       )
               if module.bias is not None:
                    module.bias.data.zero_()
          elif isinstance(_a	,  nn.LayerNorm       ):
               module.bias.data.zero_()
               module.weight.data.fill_(1.0       )



     def       a__			(						self	,  _a	,  _a=False       )		->							Union[str, Any]:
          if isinstance(_a	,  _a       ):
               _A							:  List[str]    =		value


_snake_case            = r"\n    This model is a PyTorch [torch.nn.Module](https://pytorch.org/docs/stable/nn.html#torch.nn.Module) sub-class. Use\n    it as a regular PyTorch Module and refer to the PyTorch documentation for all matter related to general usage and\n    behavior.\n\n    Parameters:\n        config ([`PoolFormerConfig`]): Model configuration class with all the parameters of the model.\n            Initializing with a config file does not load the weights associated with the model, only the\n            configuration. Check out the [`~PreTrainedModel.from_pretrained`] method to load the model weights.\n"

_snake_case            = r"\n    Args:\n        pixel_values (`torch.FloatTensor` of shape `(batch_size, num_channels, height, width)`):\n            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See\n            [`PoolFormerImageProcessor.__call__`] for details.\n"







@add_start_docstrings(
    "The bare PoolFormer Model transformer outputting raw hidden-states without any specific head on top.",UpperCamelCase__,)
class 		lowercase							(     UpperCamelCase__	):

     def __init__(						self	,  _a       )		->							List[str]:
          super().__init__(_a       )
          _A							:  Any    =		config

          _A							:  Union[str, Any]    =		PoolFormerEncoder(_a       )

          # Initialize weights and apply final processing
          self.post_init()

     def       a__			(						self       )		->							str:
          return self.embeddings.patch_embeddings



     @add_start_docstrings_to_model_forward(_a       )
     @add_code_sample_docstrings(
         checkpoint=_CHECKPOINT_FOR_DOC	,  output_type=_a	,  config_class=_CONFIG_FOR_DOC	,  modality="""vision"""	,  expected_output=_EXPECTED_OUTPUT_SHAPE	,  )
     def       a__			(						self	,  _a = None	,  _a = None	,  _a = None	,  )		->							Union[Tuple, BaseModelOutputWithNoAttention]:
          _A							:  Optional[int]    =		(
              output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
          )
          _A							:  List[str]    =		return_dict if return_dict is not None else self.config.use_return_dict

          if pixel_values is None:
               raise ValueError("""You have to specify pixel_values"""       )

          _A							:  Any    =		self.encoder(
              _a	,  output_hidden_states=_a	,  return_dict=_a	,  )
          _A							:  Optional[int]    =		encoder_outputs[0]

          if not return_dict:
               return (sequence_output, None) + encoder_outputs[1:]

          return BaseModelOutputWithNoAttention(
              last_hidden_state=_a	,  hidden_states=encoder_outputs.hidden_states	,  )







class 		lowercase							(     nn.Module	):

     def __init__(						self	,  _a       )		->							Tuple:
          super().__init__()
          _A							:  List[str]    =		nn.Linear(config.hidden_size	,  config.hidden_size       )



     def       a__			(						self	,  _a       )		->							Tuple:
          _A							:  str    =		self.dense(_a       )
          return output







@add_start_docstrings(
    "\n    PoolFormer Model transformer with an image classification head on top\n    ",UpperCamelCase__,)
class 		lowercase							(     UpperCamelCase__	):

     def __init__(						self	,  _a       )		->							List[Any]:
          super().__init__(_a       )
          _A							:  Tuple    =		config.num_labels
          _A							:  Optional[Any]    =		PoolFormerModel(_a       )

          # Final norm
          _A							:  Optional[int]    =		PoolFormerGroupNorm(config.hidden_sizes[-1]       )
          # Classifier head
          _A							:  str    =		(
              nn.Linear(config.hidden_sizes[-1]	,  config.num_labels       ) if config.num_labels > 0 else nn.Identity()
          )

          # Initialize weights and apply final processing
          self.post_init()



     @add_start_docstrings_to_model_forward(_a       )
     @add_code_sample_docstrings(
         checkpoint=_IMAGE_CLASS_CHECKPOINT	,  output_type=_a	,  config_class=_CONFIG_FOR_DOC	,  expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT	,  )
     def       a__			(						self	,  _a = None	,  _a = None	,  _a = None	,  _a = None	,  )		->							Union[Tuple, ImageClassifierOutputWithNoAttention]:
          _A							:  Optional[Any]    =		return_dict if return_dict is not None else self.config.use_return_dict

          _A							:  Optional[Any]    =		self.poolformer(
              _a	,  output_hidden_states=_a	,  return_dict=_a	,  )

          _A							:  Tuple    =		outputs[0]

          _A							:  Any    =		self.classifier(self.norm(_a       ).mean([-2, -1]       )       )

          _A							:  Dict    =		None
          if labels is not None:
               if self.config.problem_type is None:
                    if self.num_labels == 1:
                         _A							:  Union[str, Any]    =		"""regression"""
                    elif self.num_labels > 1 and (labels.dtype == torch.long or labels.dtype == torch.int):
                         _A							:  Optional[int]    =		"""single_label_classification"""
                    else:
                         _A							:  List[Any]    =		"""multi_label_classification"""

               if self.config.problem_type == "regression":
                    _A							:  Union[str, Any]    =		MSELoss()
                    if self.num_labels == 1:
                         _A							:  str    =		loss_fct(logits.squeeze()	,  labels.squeeze()       )
                    else:
                         _A							:  Optional[Any]    =		loss_fct(_a	,  _a       )
               elif self.config.problem_type == "single_label_classification":
                    _A							:  List[str]    =		CrossEntropyLoss()
                    _A							:  Any    =		loss_fct(logits.view(-1	,  self.num_labels       )	,  labels.view(-1       )       )
               elif self.config.problem_type == "multi_label_classification":
                    _A							:  List[Any]    =		BCEWithLogitsLoss()
                    _A							:  Dict    =		loss_fct(_a	,  _a       )

          if not return_dict:
               _A							:  List[str]    =		(logits,) + outputs[2:]
               return ((loss,) + output) if loss is not None else output

          return ImageClassifierOutputWithNoAttention(loss=_a	,  logits=_a	,  hidden_states=outputs.hidden_states       )







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

import black


_snake_case            = 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.
_snake_case            = "    def __init__(self, config):\n        super().__init__()\n        self.transform = BertPredictionHeadTransform(config)\n\n        # The output weights are the same as the input embeddings, but there is\n        # an output-only bias for each token.\n        self.decoder = nn.Linear(config.hidden_size, config.vocab_size, bias=False)\n\n        self.bias = nn.Parameter(torch.zeros(config.vocab_size))\n\n        # Need a link between the two variables so that the bias is correctly resized with `resize_token_embeddings`\n        self.decoder.bias = self.bias\n\n    def forward(self, hidden_states):\n        hidden_states = self.transform(hidden_states)\n        hidden_states = self.decoder(hidden_states)\n        return hidden_states\n"







class 		lowercase							(     unittest.TestCase	):

     def       a__			(						self       )		->							Union[str, Any]:
           _A							:  List[str]    =		tempfile.mkdtemp()
           os.makedirs(os.path.join(self.transformer_dir	,  """models/bert/"""       )       )
           _A							:  str    =		self.transformer_dir
           shutil.copy(
               os.path.join(_a	,  """src/transformers/models/bert/modeling_bert.py"""       )	,  os.path.join(self.transformer_dir	,  """models/bert/modeling_bert.py"""       )	,  )

     def       a__			(						self       )		->							Optional[int]:
           _A							:  List[str]    =		"""src/transformers"""
           shutil.rmtree(self.transformer_dir       )

     def       a__			(						self	,  _a	,  _a	,  _a	,  _a=None       )		->							Optional[Any]:
           _A							:  Optional[Any]    =		comment + F'''\nclass {class_name}(nn.Module):\n''' + class_code
           if overwrite_result is not None:
                 _A							:  List[str]    =		comment + F'''\nclass {class_name}(nn.Module):\n''' + overwrite_result
           _A							:  List[str]    =		black.Mode(target_versions={black.TargetVersion.PYaa}	,  line_length=119       )
           _A							:  Optional[int]    =		black.format_str(_a	,  mode=_a       )
           _A							:  Optional[Any]    =		os.path.join(self.transformer_dir	,  """new_code.py"""       )
           with open(_a	,  """w"""	,  newline="""\n"""       ) as f:
                 f.write(_a       )
           if overwrite_result is None:
                 self.assertTrue(len(check_copies.is_copy_consistent(_a       )       ) == 0       )
           else:
                 check_copies.is_copy_consistent(f.name	,  overwrite=_a       )
                 with open(_a	,  """r"""       ) as f:
                       self.assertTrue(f.read()	,  _a       )

     def       a__			(						self       )		->							str:
           _A							:  Union[str, Any]    =		check_copies.find_code_in_transformers("""models.bert.modeling_bert.BertLMPredictionHead"""       )
           self.assertEqual(_a	,  _a       )

     def       a__			(						self       )		->							int:
           # Base copy consistency
           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"""	,  _a	,  )

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

           # Copy consistency with a really long name
           _A							:  List[str]    =		"""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"""	,  _a	,  _a       )	,  )

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



     def       a__			(						self       )		->							Tuple:
           _A							:  Union[str, Any]    =		check_copies.LOCALIZED_READMES["""README_zh-hans.md"""]

           _A							:  str    =		(
               """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							:  str    =		(
               """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							:  Any    =		(
               """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							:  Tuple    =		check_copies.convert_to_localized_md(
               _a	,  _a	,  localized_readme["""format_model_list"""]       )

           self.assertFalse(_a       )
           self.assertEqual(_a	,  _a       )

           _A    ,     _A							:  List[str]    =		check_copies.convert_to_localized_md(
               _a	,  _a	,  localized_readme["""format_model_list"""]       )

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

           _A							:  Tuple    =		(
               """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							:  Dict    =		(
               """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							:  Optional[Any]    =		(
               """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							:  Optional[int]    =		check_copies.convert_to_localized_md(
               _a	,  _a	,  localized_readme["""format_model_list"""]       )

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

