






'''simple docstring'''
import argparse

from transformers import CanineConfig, CanineModel, CanineTokenizer, load_tf_weights_in_canine
from transformers.utils import logging


logging.set_verbosity_info()

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase )				->				Optional[int]:






					"""simple docstring"""







					a_									=   CanineConfig()
					a_									=   CanineModel(_UpperCamelCase )
					model.eval()

					print(F'''Building PyTorch model from configuration: {config}''' )

					# Load weights from tf checkpoint
					load_tf_weights_in_canine(_UpperCamelCase					,  _UpperCamelCase					,  _UpperCamelCase )

					# Save pytorch-model (weights and configuration)
					print(F'''Save PyTorch model to {pytorch_dump_path}''' )
					model.save_pretrained(_UpperCamelCase )

					# Save tokenizer files
					a_									=   CanineTokenizer()
					print(F'''Save tokenizer files to {pytorch_dump_path}''' )
					tokenizer.save_pretrained(_UpperCamelCase )


if __name__ == "__main__":
						__lowerCAmelCase							=argparse.ArgumentParser()
						# Required parameters
						parser.add_argument(
						    "--tf_checkpoint_path",
						    default=None,
						    type=str,
						    required=True,
						    help="Path to the TensorFlow checkpoint. Should end with model.ckpt",
						)
						parser.add_argument(
						    "--pytorch_dump_path",
						    default=None,
						    type=str,
						    required=True,
						    help="Path to a folder where the PyTorch model will be placed.",
						)
						__lowerCAmelCase							=parser.parse_args()
						convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.pytorch_dump_path)









'''simple docstring'''
def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 9 / 5) + 3_2					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(float(_UpperCAmelCase ) + 2_7_3.1_5					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 9 / 5) + 4_9_1.6_7					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) - 3_2) * 5 / 9					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(((float(_UpperCAmelCase ) - 3_2) * 5 / 9) + 2_7_3.1_5					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(float(_UpperCAmelCase ) + 4_5_9.6_7					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(float(_UpperCAmelCase ) - 2_7_3.1_5					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(((float(_UpperCAmelCase ) - 2_7_3.1_5) * 9 / 5) + 3_2					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 9 / 5)					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) - 4_9_1.6_7) * 5 / 9					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round(float(_UpperCAmelCase ) - 4_5_9.6_7					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 5 / 9)					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 1.2_5 + 2_7_3.1_5)					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 2.2_5 + 3_2)					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 1.2_5)					,  _UpperCAmelCase )

def 							a	(   _UpperCAmelCase					,  _UpperCAmelCase = 2 )				->				float:






					"""simple docstring"""







					return round((float(_UpperCAmelCase ) * 2.2_5 + 3_2 + 4_5_9.6_7)					,  _UpperCAmelCase )


if __name__ == "__main__":
						import doctest

						doctest.testmod()

