




"""simple docstring"""







import argparse

import torch

from ...utils import logging
from . import AlbertConfig, AlbertForPreTraining, load_tf_weights_in_albert


logging.set_verbosity_info()


def      __lowerCAmelCase(		__UpperCAmelCase     ,__UpperCAmelCase     ,__UpperCAmelCase			):






	"""simple docstring"""





	_lowercase :    int							=							AlbertConfig.from_json_file(_lowercase			)
	print(F'''Building PyTorch model from configuration: {config}'''			)
	_lowercase :    Optional[Any]							=							AlbertForPreTraining(_lowercase			)

	# Load weights from tf checkpoint
	load_tf_weights_in_albert(_lowercase     ,_lowercase     ,_lowercase			)

	# Save pytorch-model
	print(F'''Save PyTorch model to {pytorch_dump_path}'''			)
	torch.save(model.state_dict()     ,_lowercase			)


if __name__ == "__main__":
						SCREAMING_SNAKE_CASE									=						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(
						    '--albert_config_file',
						    default=None,
						    type=str,
						    required=True,
						    help=(
						        'The config json file corresponding to the pre-trained ALBERT 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									=						parser.parse_args()
						convert_tf_checkpoint_to_pytorch(args.tf_checkpoint_path, args.albert_config_file, args.pytorch_dump_path)




"""simple docstring"""







from typing import Any


def      __lowerCAmelCase(		__UpperCAmelCase			):






	"""simple docstring"""





	if not input_list:
		return []
	_lowercase :    List[str]							=							[input_list.count(__UpperCAmelCase			) for value in input_list]
	_lowercase :    Optional[int]							=							max(__UpperCAmelCase			)  # Gets the maximum count in the input list.
	# Gets values of modes
	return sorted({input_list[i] for i, value in enumerate(__UpperCAmelCase			) if value == y}			)


if __name__ == "__main__":
						import doctest

						doctest.testmod()



