



"""simple docstring"""







import argparse

from transformers import CanineConfig, CanineModel, CanineTokenizer, load_tf_weights_in_canine
from transformers.utils import logging


logging.set_verbosity_info()


def  __SCREAMING_SNAKE_CASE (  __UpperCAmelCase   ,				__UpperCAmelCase      ):
		# Initialize PyTorch model
		_lowercase				: Union[str, Any]     =   CanineConfig()
		_lowercase				: Union[str, Any]     =   CanineModel(__UpperCAmelCase      )
		model.eval()

		print(F"""Building PyTorch model from configuration: {config}"""      )

		# Load weights from tf checkpoint
		load_tf_weights_in_canine(__UpperCAmelCase   ,				__UpperCAmelCase   ,				__UpperCAmelCase      )

		# Save pytorch-model (weights and configuration)
		print(F"""Save PyTorch model to {pytorch_dump_path}"""      )
		model.save_pretrained(__UpperCAmelCase      )

		# Save tokenizer files
		_lowercase				: Optional[Any]     =   CanineTokenizer()
		print(F"""Save tokenizer files to {pytorch_dump_path}"""      )
		tokenizer.save_pretrained(__UpperCAmelCase      )


if __name__ == "__main__":
		UpperCAmelCase:  int			     =				argparse.ArgumentParser()
		# Required parameters
		parser.add_argument(
		    """--tf_checkpoint_path""",
		    default=None,
		    type=str,
		    required=True,
		    help="""Path to the TensorFlow checkpoint. Should end with model.ckpt""",
		)
		parser.add_argument(
		    """--pytorch_dump_path""",
		    default=None,
		    type=str,
		    required=True,
		    help="""Path to a folder where the PyTorch model will be placed.""",
		)
		UpperCAmelCase:  Any			     =				parser.parse_args()
		convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.pytorch_dump_path)









'''simple docstring'''





from __future__ import annotations

import sys





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_						):
    # base cases
    if abs(UpperCAmelCase_						) == 1:
        return a, 0
    elif abs(UpperCAmelCase_						) == 1:
        return 0, b

    _a       , _a				:							List[Any]							       =      a, b
    _a       , _a				:							str							       =      1, 0
    _a       , _a				:							Union[str, Any]							       =      0, 1

    while remainder != 0:
        _a				:							List[Any]							       =      old_remainder // remainder
        _a       , _a				:							str							       =      remainder, old_remainder - quotient * remainder
        _a       , _a				:							Optional[Any]							       =      coeff_a, old_coeff_a - quotient * coeff_a
        _a       , _a				:							Tuple							       =      coeff_b, old_coeff_b - quotient * coeff_b

    # sign correction for negative numbers
    if a < 0:
        _a				:							Tuple							       =      -old_coeff_a
    if b < 0:
        _a				:							Any							       =      -old_coeff_b

    return old_coeff_a, old_coeff_b





def UpperCAmelCase    (       ):
    if len(sys.argv						) < 3:
        print("""2 integer arguments required"""						)
        return 1
    _a				:							Union[str, Any]							       =      int(sys.argv[1]						)
    _a				:							Any							       =      int(sys.argv[2]						)
    print(extended_euclidean_algorithm(UpperCAmelCase_   ,	UpperCAmelCase_						)						)
    return 0


if __name__ == "__main__":
  raise SystemExit(main())


