

"""simple docstring"""






import argparse

from transformers import ConvBertConfig, ConvBertModel, TFConvBertModel, load_tf_weights_in_convbert
from transformers.utils import logging


logging.set_verbosity_info()
def       UpperCamelCase					(			_lowerCAmelCase     :						List[str],  _lowerCAmelCase     :						Optional[int],  _lowerCAmelCase     :						List[Any] )				->			Any:
	_UpperCAmelCase    :							int									=					ConvBertConfig.from_json_file(_lowerCAmelCase )
	_UpperCAmelCase    :							str									=					ConvBertModel(_lowerCAmelCase )

	_UpperCAmelCase    :							Optional[int]									=					load_tf_weights_in_convbert(_lowerCAmelCase,  _lowerCAmelCase,  _lowerCAmelCase )
	model.save_pretrained(_lowerCAmelCase )

	_UpperCAmelCase    :							Dict									=					TFConvBertModel.from_pretrained(_lowerCAmelCase,  from_pt=_lowerCAmelCase )
	tf_model.save_pretrained(_lowerCAmelCase )


if __name__ == "__main__":
						lowerCamelCase__				:  Tuple													=  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(
						    '''--convbert_config_file''',
						    default=None,
						    type=str,
						    required=True,
						    help=(
						        '''The config json file corresponding to the pre-trained ConvBERT 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.'''
						)
						lowerCamelCase__				:  int													=  parser.parse_args()
						convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)








"""simple docstring"""






def       UpperCamelCase					(			_lowerCAmelCase     :						int )				->			str:
	_UpperCAmelCase    :							Any									=					1
	_UpperCAmelCase    :							List[str]									=					0
	_UpperCAmelCase    :							str									=					1
	_UpperCAmelCase    :							Union[str, Any]									=					1
	_UpperCAmelCase    :							int									=					3
	_UpperCAmelCase    :							int									=					3
	_UpperCAmelCase    :							List[str]									=					limit
	_UpperCAmelCase    :							Optional[Any]									=					0

	_UpperCAmelCase    :							Any									=					""""""
	while counter != decimal + 1:
		if 4 * q + r - t < n * t:
			result += str(_lowerCAmelCase )
			if counter == 0:
				result += "."

			if decimal == counter:
				break

			counter += 1
			_UpperCAmelCase    :							str									=					10 * (r - n * t)
			_UpperCAmelCase    :							List[Any]									=					((10 * (3 * q + r)) // t) - 10 * n
			q *= 10
			_UpperCAmelCase    :							int									=					nr
		else:
			_UpperCAmelCase    :							Any									=					(2 * q + r) * l
			_UpperCAmelCase    :							str									=					(q * (7 * k) + 2 + (r * l)) // (t * l)
			q *= k
			t *= l
			l += 2
			k += 1
			_UpperCAmelCase    :							List[Any]									=					nn
			_UpperCAmelCase    :							Optional[int]									=					nr
	return result
def       UpperCamelCase					(			)				->			None:
	print(f'''{calculate_pi(50 ) = }''' )
	import doctest

	doctest.testmod()


if __name__ == "__main__":
						main()





