



'''simple docstring'''






import argparse

import torch

from transformers import RoFormerConfig, RoFormerForMaskedLM, load_tf_weights_in_roformer
from transformers.utils import logging


logging.set_verbosity_info()


def 			snake_case_					( _lowerCAmelCase  :						Optional[int]       ,				_lowerCAmelCase  :						int       ,				_lowerCAmelCase  :						int  )				->       List[Any]:
							# Initialise PyTorch model
							UpperCAmelCase			:	str										=		RoFormerConfig.from_json_file(_lowerCAmelCase  )
							print(f"""Building PyTorch model from configuration: {config}"""  )
							UpperCAmelCase			:	Dict										=		RoFormerForMaskedLM(_lowerCAmelCase  )

							# Load weights from tf checkpoint
							load_tf_weights_in_roformer(_lowerCAmelCase       ,				_lowerCAmelCase       ,				_lowerCAmelCase  )

							# Save pytorch-model
							print(f"""Save PyTorch model to {pytorch_dump_path}"""  )
							torch.save(model.state_dict()       ,				_lowerCAmelCase       ,				_use_new_zipfile_serialization=_lowerCAmelCase  )


if __name__ == "__main__":
						UpperCamelCase__:       List[Any]							     =      argparse.ArgumentParser()
						# Required parameters
						parser.add_argument(
						    "--tf_checkpoint_path", default=None, type=str, required=True, help="Path to the TensorFlow checkpoint path."
						)
						parser.add_argument(
						    "--bert_config_file",
						    default=None,
						    type=str,
						    required=True,
						    help=(
						        "The config json file corresponding to the pre-trained BERT model. \n"
						        "This specifies the model architecture."
						    ),
						)
						parser.add_argument(
						    "--pytorch_dump_path", default=None, type=str, required=True, help="Path to the output PyTorch model."
						)
						UpperCamelCase__:       str							     =      parser.parse_args()
						convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.bert_config_file, args.pytorch_dump_path)










'''simple docstring'''






from __future__ import annotations


def 			snake_case_					( _lowerCAmelCase  :						list[int]       ,				_lowerCAmelCase  :						int  )				->       list[int]:
							UpperCAmelCase			:	dict[int, int]										=		{}
							for index, val in enumerate(_lowerCAmelCase  ):
														UpperCAmelCase			:	Tuple										=		target - val
														if compl in chk_map:
																					return [chk_map[compl], index]
														UpperCAmelCase			:	Any										=		index
							return []


if __name__ == "__main__":
						import doctest

						doctest.testmod()
						print(F"{two_sum([2, 7, 11, 15], 9) = }")





