






import argparse

import torch

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


logging.set_verbosity_info()





def 				snake_case  (     lowerCamelCase				,  lowerCamelCase				,  lowerCamelCase					):




	'''simple docstring'''







	__lowercase             =  RemBertConfig.from_json_file(lowerCamelCase					)
	print("""Building PyTorch model from configuration: {}""".format(str(lowerCamelCase					)					)					)
	__lowercase             =  RemBertModel(lowerCamelCase					)

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

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


if __name__ == "__main__":
						__UpperCamelCase      :      int     						=						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      :      int     						=						parser.parse_args()
						convert_rembert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.rembert_config_file, args.pytorch_dump_path)









def 				snake_case  (     lowerCamelCase					):




	'''simple docstring'''







	if not isinstance(lowerCamelCase				,  lowerCamelCase					):
		raise ValueError("""check_bouncy() accepts only integer arguments"""					)
	__lowercase             =  str(lowerCamelCase					)
	__lowercase             =  """""".join(sorted(lowerCamelCase					)					)
	return sorted_str_n != str_n and sorted_str_n[::-1] != str_n





def 				snake_case  (     lowerCamelCase = 99					):




	'''simple docstring'''







	if not 0 < percent < 100:
		raise ValueError("""solution() only accepts values from 0 to 100"""					)
	__lowercase             =  0
	__lowercase             =  1

	while True:
		if check_bouncy(lowerCamelCase					):
			bouncy_num += 1
		if (bouncy_num / num) * 100 >= percent:
			return num
		num += 1


if __name__ == "__main__":
						from doctest import testmod

						testmod()
						print(F'''{solution(99)}''')

