




'''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						(	snake_case						,  snake_case						,  snake_case ):




   '''simple docstring'''

   SCREAMING_SNAKE_CASE__      :					Union[str, Any]							    =			ConvBertConfig.from_json_file(snake_case )
   SCREAMING_SNAKE_CASE__      :					List[Any]							    =			ConvBertModel(snake_case )

   SCREAMING_SNAKE_CASE__      :					Union[str, Any]							    =			load_tf_weights_in_convbert(snake_case						,  snake_case						,  snake_case )
   model.save_pretrained(snake_case )

   SCREAMING_SNAKE_CASE__      :					Any							    =			TFConvBertModel.from_pretrained(snake_case						,  from_pt=snake_case )
   tf_model.save_pretrained(snake_case )


if __name__ == "__main__":
       lowercase__								=						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.'''
       )
       lowercase__								=						parser.parse_args()
       convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)







'''simple docstring'''





import math
from decimal import Decimal, getcontext


def 					UpperCamelCase						(	snake_case = 4_00_00_00 ):




   '''simple docstring'''

   try:
      SCREAMING_SNAKE_CASE__      :					List[Any]							    =			int(snake_case )
   except (TypeError, ValueError):
      raise TypeError('''Parameter n must be int or castable to int.''' )
   if n <= 0:
      raise ValueError('''Parameter n must be greater than or equal to one.''' )
   SCREAMING_SNAKE_CASE__      :					Optional[int]							    =			1_00
   SCREAMING_SNAKE_CASE__      :					int							    =			(Decimal(5 ) ** Decimal(0.5 ) + 1) / Decimal(2 )

   SCREAMING_SNAKE_CASE__      :					int							    =			(math.floor(math.log(n * (phi + 2)						,  snake_case ) - 1 ) // 3) * 3 + 2
   SCREAMING_SNAKE_CASE__      :					int							    =			Decimal(round(phi ** Decimal(index + 1 ) ) ) / (phi + 2)
   SCREAMING_SNAKE_CASE__      :					Any							    =			num // 2
   return int(snake_case )


if __name__ == "__main__":
       print(F"{solution() = }")

