




import argparse

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


logging.set_verbosity_info()

def       lowerCAmelCase_      (	lowerCamelCase:							Optional[Any]  ,					lowerCamelCase:							int  ,					lowerCamelCase:							Tuple    )       ->      Union[str, Any]:


      '''simple docstring'''




      lowerCamelCase__   	=					ConvBertConfig.from_json_file(lowerCamelCase    )
      lowerCamelCase__   	=					ConvBertModel(lowerCamelCase    )

      lowerCamelCase__   	=					load_tf_weights_in_convbert(lowerCamelCase  ,					lowerCamelCase  ,					lowerCamelCase    )
      model.save_pretrained(lowerCamelCase    )

      lowerCamelCase__   	=					TFConvBertModel.from_pretrained(lowerCamelCase  ,					from_pt=lowerCamelCase    )
      tf_model.save_pretrained(lowerCamelCase    )


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     : Union[str, Any]      =parser.parse_args()
      convert_orig_tfa_checkpoint_to_pytorch(args.tf_checkpoint_path, args.convbert_config_file, args.pytorch_dump_path)






from __future__ import annotations

from collections.abc import Generator







def  A					(				UpperCAmelCase					):
					if not isinstance(UpperCAmelCase	,	UpperCAmelCase					) or n < 1:
										raise Exception("Sequence only defined for positive integers"					)

					yield n
					while n != 1:
										if n % 2 == 0:
															n //= 2
										else:
															_snake_case							:       Any												= 3 * n + 1
										yield n







def  A					(				):
					_snake_case							:       Dict												= 43
					_snake_case							:       List[str]												= tuple(collatz_sequence(UpperCAmelCase					)					)
					print(UpperCAmelCase					)
					print(F"""Collatz sequence from {n} took {len(UpperCAmelCase					)} steps."""					)


if __name__ == "__main__":
							main()