


import argparse

import torch
from torch import nn

from transformers import PLBartConfig, PLBartForConditionalGeneration, PLBartForSequenceClassification






def 				UpperCamelCase      (			__magic_name__  :							List[Any]  )     ->						str:
		"""simple docstring"""




		lowercase__      =	[
		    """encoder.version""",
		    """decoder.version""",
		    """model.encoder.version""",
		    """model.decoder.version""",
		    """_float_tensor""",
		    """decoder.output_projection.weight""",
		]
		for k in ignore_keys:
				state_dict.pop(__magic_name__					,					__magic_name__  )






def 				UpperCamelCase      (			__magic_name__  :							List[str]  )     ->						Dict:
		"""simple docstring"""




		lowercase__    ,			lowercase__      =	emb.weight.shape
		lowercase__      =	nn.Linear(__magic_name__					,					__magic_name__					,					bias=__magic_name__  )
		lowercase__      =	emb.weight.data
		return lin_layer






def 				UpperCamelCase      (			__magic_name__  :							List[Any]					,					__magic_name__  :							Tuple="uclanlp/plbart-base"					,					__magic_name__  :							Optional[int]=False					,					__magic_name__  :							str=False  )     ->						Union[str, Any]:
		"""simple docstring"""




		lowercase__      =	torch.load(__magic_name__					,					map_location="""cpu"""  )["""model"""]
		remove_ignore_keys_(__magic_name__  )
		lowercase__      =	state_dict["""encoder.embed_tokens.weight"""].shape[0]

		lowercase__      =	PLBartConfig.from_pretrained(__magic_name__					,					vocab_size=__magic_name__  )

		lowercase__      =	state_dict["""decoder.embed_tokens.weight"""]
		if not classification:
				lowercase__      =	PLBartForConditionalGeneration(__magic_name__  )
				model.model.load_state_dict(__magic_name__  )
				if finetuned:
						lowercase__      =	make_linear_from_emb(model.model.shared  )

		else:
				lowercase__      =	{}
				for key, value in state_dict.copy().items():
						if key.startswith("""classification_heads.sentence_classification_head"""  ):
								lowercase__      =	value
								state_dict.pop(__magic_name__  )
				lowercase__      =	PLBartForSequenceClassification(__magic_name__  )
				model.model.load_state_dict(__magic_name__  )
				model.classification_head.load_state_dict(__magic_name__  )

		return model


if __name__ == "__main__":
	A :	Any												=     argparse.ArgumentParser()
	# Required parameters
	parser.add_argument('fairseq_path', type=str, help='model.pt on local filesystem.')
	parser.add_argument('pytorch_dump_folder_path', default=None, type=str, help='Path to the output PyTorch model.')
	parser.add_argument(
	    '--hf_config',
	    default='uclanlp/plbart-base',
	    type=str,
	    help='Which huggingface architecture to use: plbart-base',
	)
	parser.add_argument('--finetuned', action='store_true', help='whether the model is a fine-tuned checkpoint')
	parser.add_argument(
	    '--classification', action='store_true', help='whether the model is a classification checkpoint'
	)
	A :	str												=     parser.parse_args()
	A :	Optional[int]												=     convert_fairseq_plbart_checkpoint_from_disk(
	    args.fairseq_path,
	    hf_config_path=args.hf_config,
	    finetuned=args.finetuned,
	    classification=args.classification,
	)
	model.save_pretrained(args.pytorch_dump_folder_path)





import math






def 				UpperCamelCase      (			__magic_name__  :							int  )     ->						bool:
		"""simple docstring"""




		if 1 < number < 4:
				# 2 and 3 are primes
				return True
		elif number < 2 or number % 2 == 0 or number % 3 == 0:
				# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
				return False

		# All primes number are in format of 6k +/- 1
		for i in range(5					,					int(math.sqrt(__magic_name__  ) + 1  )					,					6  ):
				if number % i == 0 or number % (i + 2) == 0:
						return False
		return True






def 				UpperCamelCase      (			__magic_name__  :							int = 1000					,					__magic_name__  :							int = 1000  )     ->						int:
		"""simple docstring"""




		lowercase__      =	[0, 0, 0]  # length, a, b
		for a in range((a_limit * -1) + 1					,					__magic_name__  ):
				for b in range(2					,					__magic_name__  ):
						if is_prime(__magic_name__  ):
								lowercase__      =	0
								lowercase__      =	0
								while is_prime((n**2) + (a * n) + b  ):
										count += 1
										n += 1
								if count > longest[0]:
										lowercase__      =	[count, a, b]
		lowercase__      =	longest[1] * longest[2]
		return ans


if __name__ == "__main__":
	print(solution(1_0_0_0, 1_0_0_0))

