

import argparse

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


logging.set_verbosity_info()







def      snake_case__							(  lowerCAmelCase_,       lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=CanineConfig()
     SCREAMING_SNAKE_CASE 		=CanineModel(lowerCAmelCase_     )
     model.eval()

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

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

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

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


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)




import numpy as np







def      snake_case__							(  lowerCAmelCase_     ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE 		=np.exp(lowerCAmelCase_     )

     # Add up the all the exponentials
     SCREAMING_SNAKE_CASE 		=np.sum(lowerCAmelCase_     )

     # Divide every exponent by the sum of all exponents
     SCREAMING_SNAKE_CASE 		=exponent_vector / sum_of_exponents

     return softmax_vector


if __name__ == "__main__":
 print(softmax((0,)))

