

'''simple docstring'''



import argparse
import ast
import logging
import os
import sys

import pandas as pd
import torch
from tqdm import tqdm

from transformers import BartForConditionalGeneration, RagRetriever, RagSequenceForGeneration, RagTokenForGeneration
from transformers import logging as transformers_logging


sys.path.append(os.path.join(os.getcwd()))  # noqa: E402 # isort:skip
from utils_rag import exact_match_score, fa_score  # noqa: E402 # isort:skip


__snake_case			:     Optional[Any]										=      logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)

transformers_logging.set_verbosity_info()
def 						__lowerCamelCase	(       __snake_case					:		Union[str, Any]	)	->							Tuple:






						"""simple docstring"""





						if "token" in model_name_or_path:
												return "rag_token"
						if "sequence" in model_name_or_path:
												return "rag_sequence"
						if "bart" in model_name_or_path:
												return "bart"
						return None
def 						__lowerCamelCase	(       __snake_case					:		Union[str, Any],		__snake_case					:		str,		__snake_case					:		int	)	->							Optional[int]:






						"""simple docstring"""





						return max(metric_fn(__snake_case,		__snake_case	) for gt in ground_truths	)
def 						__lowerCamelCase	(       __snake_case					:		Tuple,		__snake_case					:		Dict,		__snake_case					:		Optional[Any]	)	->							int:






						"""simple docstring"""





						A__					:       Union[str, Any]     =[line.strip() for line in open(__snake_case,		"""r"""	).readlines()]
						A__					:       Union[str, Any]     =[]

						if args.gold_data_mode == "qa":
												A__					:       List[Any]     =pd.read_csv(__snake_case,		sep="""\t""",		header=__snake_case	)
												for answer_list in data[1]:
																		A__					:       List[Any]     =ast.literal_eval(__snake_case	)
																		answers.append(__snake_case	)
						else:
												A__					:       str     =[line.strip() for line in open(__snake_case,		"""r"""	).readlines()]
												A__					:       Optional[Any]     =[[reference] for reference in references]

						A__					:       int     =0
						for prediction, ground_truths in zip(__snake_case,		__snake_case	):
												total += 1
												em += metric_max_over_ground_truths(__snake_case,		__snake_case,		__snake_case	)
												fa += metric_max_over_ground_truths(__snake_case,		__snake_case,		__snake_case	)

						A__					:       List[Any]     =1_00.0 * em / total
						A__					:       Optional[Any]     =1_00.0 * fa / total

						logger.info(f"F1: {fa:.2f}"	)
						logger.info(f"EM: {em:.2f}"	)
def 						__lowerCamelCase	(       __snake_case					:		List[Any],		__snake_case					:		Any,		__snake_case					:		str	)	->							List[Any]:






						"""simple docstring"""





						A__					:       Union[str, Any]     =args.k
						A__					:       Union[str, Any]     =[line.strip() for line in open(__snake_case,		"""r"""	).readlines()]
						A__					:       Any     =[line.strip() for line in open(__snake_case,		"""r"""	).readlines()]

						A__					:       Optional[int]     =0
						for hypo, reference in zip(__snake_case,		__snake_case	):
												A__					:       Optional[int]     =set(hypo.split("""\t"""	)[:k]	)
												A__					:       Optional[int]     =set(reference.split("""\t"""	)	)
												total += 1
												em += len(hypo_provenance & ref_provenance	) / k

						A__					:       Tuple     =1_00.0 * em / total
						logger.info(f"Precision@{k}: {em: .2f}"	)
def 						__lowerCamelCase	(       __snake_case					:		str,		__snake_case					:		Union[str, Any],		__snake_case					:		Any	)	->							Optional[int]:






						"""simple docstring"""





						def strip_title(__snake_case					:		Dict	):
												if title.startswith("""\""""	):
																		A__					:       Dict     =title[1:]
												if title.endswith("""\""""	):
																		A__					:       List[str]     =title[:-1]
												return title

						A__					:       Union[str, Any]     =rag_model.retriever.question_encoder_tokenizer.batch_encode_plus(
						    __snake_case,		return_tensors="""pt""",		padding=__snake_case,		truncation=__snake_case,		)["""input_ids"""].to(args.device	)

						A__					:       str     =rag_model.rag.question_encoder(__snake_case	)
						A__					:       List[Any]     =question_enc_outputs[0]

						A__					:       List[Any]     =rag_model.retriever(
						    __snake_case,		question_enc_pool_output.cpu().detach().to(torch.floataa	).numpy(),		prefix=rag_model.rag.generator.config.prefix,		n_docs=rag_model.config.n_docs,		return_tensors="""pt""",		)
						A__					:       Optional[int]     =rag_model.retriever.index.get_doc_dicts(result.doc_ids	)
						A__					:       List[Any]     =[]
						for docs in all_docs:
												A__					:       Optional[Any]     =[strip_title(__snake_case	) for title in docs["""title"""]]
												provenance_strings.append("""\t""".join(__snake_case	)	)
						return provenance_strings
def 						__lowerCamelCase	(       __snake_case					:		Optional[int],		__snake_case					:		Any,		__snake_case					:		Tuple	)	->							str:






						"""simple docstring"""





						with torch.no_grad():
												A__					:       Dict     =rag_model.retriever.question_encoder_tokenizer.batch_encode_plus(
												    __snake_case,		return_tensors="""pt""",		padding=__snake_case,		truncation=__snake_case	)

												A__					:       Optional[Any]     =inputs_dict.input_ids.to(args.device	)
												A__					:       List[str]     =inputs_dict.attention_mask.to(args.device	)
												A__					:       List[Any]     =rag_model.generate(  # rag_model overwrites generate
												    __snake_case,		attention_mask=__snake_case,		num_beams=args.num_beams,		min_length=args.min_length,		max_length=args.max_length,		early_stopping=__snake_case,		num_return_sequences=1,		bad_words_ids=[[0, 0]],		)
												A__					:       List[str]     =rag_model.retriever.generator_tokenizer.batch_decode(__snake_case,		skip_special_tokens=__snake_case	)

												if args.print_predictions:
																		for q, a in zip(__snake_case,		__snake_case	):
																								logger.info("""Q: {} - A: {}""".format(__snake_case,		__snake_case	)	)

												return answers
def 						__lowerCamelCase	(       )	->							Tuple:






						"""simple docstring"""





						A__					:       int     =argparse.ArgumentParser()
						parser.add_argument(
						    """--model_type""",		choices=["""rag_sequence""", """rag_token""", """bart"""],		type=__snake_case,		help=(
						        """RAG model type: rag_sequence, rag_token or bart, if none specified, the type is inferred from the"""
						        """ model_name_or_path"""
						    ),		)
						parser.add_argument(
						    """--index_name""",		default=__snake_case,		choices=["""exact""", """compressed""", """legacy"""],		type=__snake_case,		help="""RAG model retriever type""",		)
						parser.add_argument(
						    """--index_path""",		default=__snake_case,		type=__snake_case,		help="""Path to the retrieval index""",		)
						parser.add_argument("""--n_docs""",		default=5,		type=__snake_case,		help="""Number of retrieved docs"""	)
						parser.add_argument(
						    """--model_name_or_path""",		default=__snake_case,		type=__snake_case,		required=__snake_case,		help="""Path to pretrained checkpoints or model identifier from huggingface.co/models""",		)
						parser.add_argument(
						    """--eval_mode""",		choices=["""e2e""", """retrieval"""],		default="""e2e""",		type=__snake_case,		help=(
						        """Evaluation mode, e2e calculates exact match and F1 of the downstream task, retrieval calculates"""
						        """ precision@k."""
						    ),		)
						parser.add_argument("""--k""",		default=1,		type=__snake_case,		help="""k for the precision@k calculation"""	)
						parser.add_argument(
						    """--evaluation_set""",		default=__snake_case,		type=__snake_case,		required=__snake_case,		help="""Path to a file containing evaluation samples""",		)
						parser.add_argument(
						    """--gold_data_path""",		default=__snake_case,		type=__snake_case,		required=__snake_case,		help="""Path to a tab-separated file with gold samples""",		)
						parser.add_argument(
						    """--gold_data_mode""",		default="""qa""",		type=__snake_case,		choices=["""qa""", """ans"""],		help=(
						        """Format of the gold data file"""
						        """qa - a single line in the following format: question [tab] answer_list"""
						        """ans - a single line of the gold file contains the expected answer string"""
						    ),		)
						parser.add_argument(
						    """--predictions_path""",		type=__snake_case,		default="""predictions.txt""",		help="""Name of the predictions file, to be stored in the checkpoints directory""",		)
						parser.add_argument(
						    """--eval_all_checkpoints""",		action="""store_true""",		help="""Evaluate all checkpoints starting with the same prefix as model_name ending and ending with step number""",		)
						parser.add_argument(
						    """--eval_batch_size""",		default=8,		type=__snake_case,		help="""Batch size per GPU/CPU for evaluation.""",		)
						parser.add_argument(
						    """--recalculate""",		help="""Recalculate predictions even if the prediction file exists""",		action="""store_true""",		)
						parser.add_argument(
						    """--num_beams""",		default=4,		type=__snake_case,		help="""Number of beams to be used when generating answers""",		)
						parser.add_argument("""--min_length""",		default=1,		type=__snake_case,		help="""Min length of the generated answers"""	)
						parser.add_argument("""--max_length""",		default=50,		type=__snake_case,		help="""Max length of the generated answers"""	)

						parser.add_argument(
						    """--print_predictions""",		action="""store_true""",		help="""If True, prints predictions while evaluating.""",		)
						parser.add_argument(
						    """--print_docs""",		action="""store_true""",		help="""If True, prints docs retried while generating.""",		)
						A__					:       Dict     =parser.parse_args()
						A__					:       Any     =torch.device("""cuda""" if torch.cuda.is_available() else """cpu"""	)
						return args
def 						__lowerCamelCase	(       __snake_case					:		Any	)	->							List[Any]:






						"""simple docstring"""





						A__					:       Tuple     ={}
						if args.model_type is None:
												A__					:       Optional[int]     =infer_model_type(args.model_name_or_path	)
												assert args.model_type is not None
						if args.model_type.startswith("""rag"""	):
												A__					:       List[str]     =RagTokenForGeneration if args.model_type == """rag_token""" else RagSequenceForGeneration
												A__					:       Dict     =args.n_docs
												if args.index_name is not None:
																		A__					:       Optional[Any]     =args.index_name
												if args.index_path is not None:
																		A__					:       Any     =args.index_path
						else:
												A__					:       List[Any]     =BartForConditionalGeneration

						A__					:       Any     =(
						    [f.path for f in os.scandir(args.model_name_or_path	) if f.is_dir()]
						    if args.eval_all_checkpoints
						    else [args.model_name_or_path]
						)

						logger.info("""Evaluate the following checkpoints: %s""",		__snake_case	)

						A__					:       Dict     =get_scores if args.eval_mode == """e2e""" else get_precision_at_k
						A__					:       int     =evaluate_batch_eae if args.eval_mode == """e2e""" else evaluate_batch_retrieval

						for checkpoint in checkpoints:
												if os.path.exists(args.predictions_path	) and (not args.recalculate):
																		logger.info("""Calculating metrics based on an existing predictions file: {}""".format(args.predictions_path	)	)
																		score_fn(__snake_case,		args.predictions_path,		args.gold_data_path	)
																		continue

												logger.info("""***** Running evaluation for {} *****""".format(__snake_case	)	)
												logger.info("""  Batch size = %d""",		args.eval_batch_size	)
												logger.info("""  Predictions will be stored under {}""".format(args.predictions_path	)	)

												if args.model_type.startswith("""rag"""	):
																		A__					:       List[str]     =RagRetriever.from_pretrained(__snake_case,		**__snake_case	)
																		A__					:       Any     =model_class.from_pretrained(__snake_case,		retriever=__snake_case,		**__snake_case	)
																		model.retriever.init_retrieval()
												else:
																		A__					:       Optional[Any]     =model_class.from_pretrained(__snake_case,		**__snake_case	)
												model.to(args.device	)

												with open(args.evaluation_set,		"""r"""	) as eval_file, open(args.predictions_path,		"""w"""	) as preds_file:
																		A__					:       Tuple     =[]
																		for line in tqdm(__snake_case	):
																								questions.append(line.strip()	)
																								if len(__snake_case	) == args.eval_batch_size:
																														A__					:       Optional[int]     =evaluate_batch_fn(__snake_case,		__snake_case,		__snake_case	)
																														preds_file.write("""\n""".join(__snake_case	) + """\n"""	)
																														preds_file.flush()
																														A__					:       int     =[]
																		if len(__snake_case	) > 0:
																								A__					:       Union[str, Any]     =evaluate_batch_fn(__snake_case,		__snake_case,		__snake_case	)
																								preds_file.write("""\n""".join(__snake_case	)	)
																								preds_file.flush()

																		score_fn(__snake_case,		args.predictions_path,		args.gold_data_path	)


if __name__ == "__main__":
		__snake_case			:     str										=      get_args()
		main(args)




'''simple docstring'''



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

import black


__snake_case			:     List[str]										=      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			:     Optional[int]										=      '    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 lowerCamelCase			(  unittest.TestCase						):



			'''simple docstring'''






			def lowercase__						(				self	:						Tuple			)      ->		Dict:





									'''simple docstring'''
									A__					:       Tuple     =tempfile.mkdtemp()
									os.makedirs(os.path.join(self.transformer_dir		,      """models/bert/"""			)			)
									A__					:       List[str]     =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 lowercase__						(				self	:						str			)      ->		List[str]:





									'''simple docstring'''
									A__					:       Union[str, Any]     ="""src/transformers"""
									shutil.rmtree(self.transformer_dir			)


			def lowercase__						(				self	:						Union[str, Any]		,      lowerCAmelCase_	:						Any		,      lowerCAmelCase_	:						List[Any]		,      lowerCAmelCase_	:						Optional[Any]		,      lowerCAmelCase_	:						int=None			)      ->		Dict:





									'''simple docstring'''
									A__					:       Union[str, Any]     =comment + f"\nclass {class_name}(nn.Module):\n" + class_code
									if overwrite_result is not None:
															A__					:       Optional[Any]     =comment + f"\nclass {class_name}(nn.Module):\n" + overwrite_result
									A__					:       str     =black.Mode(target_versions={black.TargetVersion.PYaa}		,      line_length=1_19			)
									A__					:       Any     =black.format_str(lowerCAmelCase_		,      mode=lowerCAmelCase_			)
									A__					:       Union[str, Any]     =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 lowercase__						(				self	:						Any			)      ->		Any:





									'''simple docstring'''
									A__					:       Dict     =check_copies.find_code_in_transformers("""models.bert.modeling_bert.BertLMPredictionHead"""			)
									self.assertEqual(lowerCAmelCase_		,      lowerCAmelCase_			)


			def lowercase__						(				self	:						Dict			)      ->		List[Any]:





									'''simple docstring'''
									# 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"""		,      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__					:       Tuple     ="""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 lowercase__						(				self	:						Optional[Any]			)      ->		Optional[int]:





									'''simple docstring'''
									A__					:       List[Any]     =check_copies.LOCALIZED_READMES["""README_zh-hans.md"""]

									A__					:       List[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__					:       Union[str, 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__					:       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 发布。\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__					:       Optional[Any]     =check_copies.convert_to_localized_md(
									    lowerCAmelCase_		,      lowerCAmelCase_		,      localized_readme["""format_model_list"""]			)

									self.assertFalse(lowerCAmelCase_			)
									self.assertEqual(lowerCAmelCase_		,      lowerCAmelCase_			)

									A__   ,						A__					:       List[str]     =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__					:       Dict     =(
									    """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__					:       str     =(
									    """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__					:       int     =(
									    """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__					:       int     =check_copies.convert_to_localized_md(
									    lowerCAmelCase_		,      lowerCAmelCase_		,      localized_readme["""format_model_list"""]			)

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

