'''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 lowerCamelCase__						(       A_       ,			A_       ,			A_       )     ->   Optional[Any]:
 UpperCAmelCase_				       =					ConvBertConfig.from_json_file(A_       )
 UpperCAmelCase_				       =					ConvBertModel(A_       )

 UpperCAmelCase_				       =					load_tf_weights_in_convbert(A_       ,			A_       ,			A_       )
 model.save_pretrained(A_       )

 UpperCAmelCase_				       =					TFConvBertModel.from_pretrained(A_       ,			from_pt=A_       )
 tf_model.save_pretrained(A_       )


if __name__ == "__main__":
      __snake_case       :   Dict  		=    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.'''
      )
      __snake_case       :   Union[str, Any]  		=    parser.parse_args()
      convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)

'''simple docstring'''

from ..utils import DummyObject, requires_backends
class 							lowercase_    (     metaclass=_A						):
    a_             =   ["""torch""", """librosa"""]







    def __init__(	self       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       int:





     """simple docstring"""

     requires_backends(self       ,     ["torch", "librosa"]				)







    @classmethod
    def   lowerCamelCase_    (	cls       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       Union[str, Any]:





     """simple docstring"""

     requires_backends(cls       ,     ["torch", "librosa"]				)







    @classmethod
    def   lowerCamelCase_    (	cls       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       Dict:





     """simple docstring"""

     requires_backends(cls       ,     ["torch", "librosa"]				)


class 							lowercase_    (     metaclass=_A						):
    a_             =   ["""torch""", """librosa"""]







    def __init__(	self       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       str:





     """simple docstring"""

     requires_backends(self       ,     ["torch", "librosa"]				)







    @classmethod
    def   lowerCamelCase_    (	cls       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       Union[str, Any]:





     """simple docstring"""

     requires_backends(cls       ,     ["torch", "librosa"]				)







    @classmethod
    def   lowerCamelCase_    (	cls       ,     *UpperCamelCase__       ,     **UpperCamelCase__				)				->       int:





     """simple docstring"""

     requires_backends(cls       ,     ["torch", "librosa"]				)
