

import argparse

import torch

from transformers import RemBertConfig, RemBertModel, load_tf_weights_in_rembert
from transformers.utils import logging


logging.set_verbosity_info()





def 							A			(  _UpperCAmelCase       :     List[str]							,     _UpperCAmelCase       :     Tuple							,     _UpperCAmelCase       :     List[Any]					)       ->				Tuple:







			'''simple docstring'''
			# Initialise PyTorch model
			_UpperCAmelCase	 =     RemBertConfig.from_json_file(UpperCAmelCase__					)
			print('Building PyTorch model from configuration: {}'.format(str(UpperCAmelCase__					)					)					)
			_UpperCAmelCase	 =     RemBertModel(UpperCAmelCase__					)

			# Load weights from tf checkpoint
			load_tf_weights_in_rembert(UpperCAmelCase__							,     UpperCAmelCase__							,     UpperCAmelCase__					)

			# Save pytorch-model
			print('Save PyTorch model to {}'.format(UpperCAmelCase__					)					)
			torch.save(model.state_dict()							,     UpperCAmelCase__					)


if __name__ == "__main__":
							UpperCAmelCase__     = 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(
							    "--rembert_config_file",
							    default=None,
							    type=str,
							    required=True,
							    help=(
							        "The config json file corresponding to the pre-trained RemBERT 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__     = parser.parse_args()
							convert_rembert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.rembert_config_file, args.pytorch_dump_path)





import os

# Precomputes a list of the 100 first triangular numbers
UpperCAmelCase__     = [int(0.5 * n * (n + 1)) for n in range(1, 101)]





def 							A			(  )       ->				List[str]:







			'''simple docstring'''
			_UpperCAmelCase	 =     os.path.dirname(os.path.realpath(_UpperCAmelCase					)					)
			_UpperCAmelCase	 =     os.path.join(_UpperCAmelCase							,     'words.txt'					)

			_UpperCAmelCase	 =     ''
			with open(_UpperCAmelCase					) as f:
						_UpperCAmelCase	 =     f.readline()

			_UpperCAmelCase	 =     [word.strip('"'					) for word in words.strip('\r\n'					).split(','					)]
			_UpperCAmelCase	 =     [
			    word
			    for word in [sum(ord(_UpperCAmelCase					) - 64 for x in word					) for word in words]
			    if word in TRIANGULAR_NUMBERS
			]
			return len(_UpperCAmelCase					)


if __name__ == "__main__":
							print(solution())
