






'''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				(			lowercase_					:     Union[str, Any]      ,					lowercase_					:     int      ,					lowercase_					:     Dict      ):
       """simple docstring"""




       a_	    = ConvBertConfig.from_json_file(lowercase_      )
       a_	    = ConvBertModel(lowercase_      )

       a_	    = load_tf_weights_in_convbert(lowercase_      ,					lowercase_      ,					lowercase_      )
       model.save_pretrained(lowercase_      )

       a_	    = TFConvBertModel.from_pretrained(lowercase_      ,					from_pt=lowercase_      )
       tf_model.save_pretrained(lowercase_      )


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 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					   =       parser.parse_args()
  convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)












'''simple docstring'''







import re


def 			__UpperCamelCase				(			lowercase_					:     int      ):
       """simple docstring"""




       def docstring_decorator(lowercase_					:     int      ):
              a_	    = fn.__doc__
              a_	    = func_doc.split('\n'      )
              a_	    = 0
              while i < len(lowercase_      ) and re.search(R'^\s*Examples?:\s*$'      ,					lines[i]      ) is None:
                     i += 1
              if i < len(lowercase_      ):
                     a_	    = example_docstring
                     a_	    = '\n'.join(lowercase_      )
              else:
                     raise ValueError(
                         F'The function {fn} should have an empty \'Examples:\' in its docstring as placeholder, '
                         F'current docstring is:\n{func_doc}'      )
              a_	    = func_doc
              return fn

       return docstring_decorator




