

'''simple docstring'''





import argparse

from transformers import BigBirdConfig, BigBirdForPreTraining, BigBirdForQuestionAnswering, load_tf_weights_in_big_bird
from transformers.utils import logging


logging.set_verbosity_info()






def 				_lowerCAmelCase			(   __magic_name__						:     Union[str, Any]   , __magic_name__						:     Dict   , __magic_name__						:     Dict   , __magic_name__						:     int						)				->  Optional[Any]:
						# Initialise PyTorch model
						lowercase :							Union[str, Any]    		=BigBirdConfig.from_json_file(__magic_name__						)
						print(f'''Building PyTorch model from configuration: {config}'''						)

						if is_trivia_qa:
												lowercase :							Union[str, Any]    		=BigBirdForQuestionAnswering(__magic_name__						)
						else:
												lowercase :							Optional[Any]    		=BigBirdForPreTraining(__magic_name__						)

						# Load weights from tf checkpoint
						load_tf_weights_in_big_bird(__magic_name__   , __magic_name__   , is_trivia_qa=__magic_name__						)

						# Save pytorch-model
						print(f'''Save PyTorch model to {pytorch_dump_path}'''						)
						model.save_pretrained(__magic_name__						)


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(
							    """--big_bird_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."""
							)
							parser.add_argument(
							    """--is_trivia_qa""", action="""store_true""", help="""Whether to convert a model with a trivia_qa head."""
							)
							UpperCamelCase_    						=       parser.parse_args()
							convert_tf_checkpoint_to_pytorch(
							    args.tf_checkpoint_path, args.big_bird_config_file, args.pytorch_dump_path, args.is_trivia_qa
							)









def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      while b:
            a				,							a		:int									=			b, a % b
      return a
def 							__lowerCamelCase		(					UpperCAmelCase_		:						int					,    UpperCAmelCase_		:						int		):




      """simple docstring"""





      return a if b == 0 else euclidean_gcd_recursive(UpperCAmelCase_					,    a % b		)
def 							__lowerCamelCase		(					):




      """simple docstring"""





      print(F'''euclidean_gcd(3, 5) = {euclidean_gcd(3					,    5		)}'''		)
      print(F'''euclidean_gcd(5, 3) = {euclidean_gcd(5					,    3		)}'''		)
      print(F'''euclidean_gcd(1, 3) = {euclidean_gcd(1					,    3		)}'''		)
      print(F'''euclidean_gcd(3, 6) = {euclidean_gcd(3					,    6		)}'''		)
      print(F'''euclidean_gcd(6, 3) = {euclidean_gcd(6					,    3		)}'''		)

      print(F'''euclidean_gcd_recursive(3, 5) = {euclidean_gcd_recursive(3					,    5		)}'''		)
      print(F'''euclidean_gcd_recursive(5, 3) = {euclidean_gcd_recursive(5					,    3		)}'''		)
      print(F'''euclidean_gcd_recursive(1, 3) = {euclidean_gcd_recursive(1					,    3		)}'''		)
      print(F'''euclidean_gcd_recursive(3, 6) = {euclidean_gcd_recursive(3					,    6		)}'''		)
      print(F'''euclidean_gcd_recursive(6, 3) = {euclidean_gcd_recursive(6					,    3		)}'''		)


if __name__ == "__main__":
     main()





