





def    __lowerCamelCase					(							__a   :list[int]    ,     __a   :str    )		->				list[int]:






		"""simple docstring"""

		A__        =   int(__a    )

		# Initialize Result
		A__        =   []

		# Traverse through all denomination
		for denomination in reversed(__a    ):
				# Find denominations
				while int(__a    ) >= int(__a    ):
						total_value -= int(__a    )
						answer.append(__a    )  # Append the "answers" array

		return answer


# Driver Code
if __name__ == "__main__":
					A    :					Optional[Any] =      []
					A    :					Union[str, Any] =      '''0'''

					if (
					    input('''Do you want to enter your denominations ? (yY/n): ''').strip().lower()
					    == "y"
					):
										A    :					List[str] =      int(input('''Enter the number of denominations you want to add: ''').strip())

										for i in range(0, n):
															denominations.append(int(input(F'''Denomination {i}: ''').strip()))
										A    :					Dict =      input('''Enter the change you want to make in Indian Currency: ''').strip()
					else:
										# All denominations of Indian Currency if user does not enter
										A    :					List[str] =      [1, 2, 5, 1_0, 2_0, 5_0, 1_0_0, 5_0_0, 2_0_0_0]
										A    :					List[str] =      input('''Enter the change you want to make: ''').strip()

					if int(value) == 0 or int(value) < 0:
										print('''The total value cannot be zero or negative.''')

					else:
										print(F'''Following is minimal change for {value}: ''')
										A    :					Dict =      find_minimum_change(denominations, value)
										# Print result
										for i in range(len(answer)):
															print(answer[i], end=''' ''')










import argparse
from argparse import Namespace

import torch
from torch import nn

from transformers import XGLMConfig, XGLMForCausalLM







def    __lowerCamelCase					(							__a   :Dict    )		->				Any:






		"""simple docstring"""

		A__        =   [
		    """decoder.version""",
		    """decoder.output_projection.weight""",
		    """_float_tensor""",
		    """decoder.embed_positions._float_tensor""",
		]
		for k in ignore_keys:
				state_dict.pop(__a    ,     __a    )







def    __lowerCamelCase					(							__a   :str    )		->				Union[str, Any]:






		"""simple docstring"""

		A__      ,			A__        =   emb.weight.shape
		A__        =   nn.Linear(__a    ,     __a    ,     bias=__a    )
		A__        =   emb.weight.data
		return lin_layer







def    __lowerCamelCase					(							__a   :str    )		->				List[str]:






		"""simple docstring"""

		A__        =   torch.load(__a    ,     map_location="""cpu"""    )
		A__        =   Namespace(**checkpoint["""cfg"""]["""model"""]    )
		A__        =   checkpoint["""model"""]
		remove_ignore_keys_(__a    )
		A__        =   state_dict["""decoder.embed_tokens.weight"""].shape[0]

		A__        =   {key.replace("""decoder"""    ,     """model"""    ): val for key, val in state_dict.items()}

		A__        =   XGLMConfig(
		    vocab_size=__a    ,     max_position_embeddings=args.max_target_positions    ,     num_layers=args.decoder_layers    ,     attention_heads=args.decoder_attention_heads    ,     ffn_dim=args.decoder_ffn_embed_dim    ,     d_model=args.decoder_embed_dim    ,     layerdrop=args.decoder_layerdrop    ,     dropout=args.dropout    ,     attention_dropout=args.attention_dropout    ,     activation_dropout=args.activation_dropout    ,     activation_function="""gelu"""    ,     scale_embedding=not args.no_scale_embedding    ,     tie_word_embeddings=args.share_decoder_input_output_embed    ,     )

		A__        =   XGLMForCausalLM(__a    )
		A__        =   model.load_state_dict(__a    ,     strict=__a    )
		print(__a    )
		A__        =   make_linear_from_emb(model.model.embed_tokens    )

		return model


if __name__ == "__main__":
					A    :					int =      argparse.ArgumentParser()
					# Required parameters
					parser.add_argument('''fairseq_path''', type=str, help='''path to a model.pt on local filesystem.''')
					parser.add_argument('''pytorch_dump_folder_path''', default=None, type=str, help='''Path to the output PyTorch model.''')
					A    :					str =      parser.parse_args()
					A    :					str =      convert_fairseq_xglm_checkpoint_from_disk(args.fairseq_path)
					model.save_pretrained(args.pytorch_dump_folder_path)



