
import argparse

from transformers import ConvBertConfig, ConvBertModel, TFConvBertModel, load_tf_weights_in_convbert
from transformers.utils import logging


logging.set_verbosity_info()


def 		UpperCAmelCase    (			a_	,     a_	,     a_		)	->			str:







				"""simple docstring"""



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

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

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


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


import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig





class 							UpperCAmelCase   (						__SCREAMING_SNAKE_CASE						):




	'''simple docstring'''





	snake_case_      					=  CustomConfig






	def __init__( self      :				Optional[int]							,A      :				List[str]				):
					super().__init__(A				)
					__A         =				torch.nn.Linear(config.hidden_size							,config.hidden_size				)






	def        UpperCamelCase_						( self      :				Union[str, Any]							,A      :				Optional[int]				):
					return self.linear(A				)







	def        UpperCamelCase_						( self      :				Optional[int]							,A      :				int				):
					pass





class 							UpperCAmelCase   (						__SCREAMING_SNAKE_CASE						):




	'''simple docstring'''





	snake_case_      					=  NoSuperInitConfig






	def __init__( self      :				Optional[int]							,A      :				Union[str, Any]				):
					super().__init__(A				)
					__A         =				torch.nn.Linear(config.attribute							,config.attribute				)






	def        UpperCamelCase_						( self      :				str							,A      :				Any				):
					return self.linear(A				)







	def        UpperCamelCase_						( self      :				Tuple							,A      :				int				):
					pass
