




import argparse
import json

import torch

from diffusers import DDPMScheduler, LDMPipeline, UNetaDModel, VQModel




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case=1       )						->				Union[str, Any]:
						if n_shave_prefix_segments >= 0:
												return ".".join(path.split("""."""       )[n_shave_prefix_segments:]       )
						else:
												return ".".join(path.split("""."""       )[:n_shave_prefix_segments]       )




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case=0       )						->				Union[str, Any]:
						_UpperCAmelCase      =			[]
						for old_item in old_list:
												_UpperCAmelCase      =			old_item.replace("""in_layers.0"""			,     """norm1"""       )
												_UpperCAmelCase      =			new_item.replace("""in_layers.2"""			,     """conv1"""       )

												_UpperCAmelCase      =			new_item.replace("""out_layers.0"""			,     """norm2"""       )
												_UpperCAmelCase      =			new_item.replace("""out_layers.3"""			,     """conv2"""       )

												_UpperCAmelCase      =			new_item.replace("""emb_layers.1"""			,     """time_emb_proj"""       )
												_UpperCAmelCase      =			new_item.replace("""skip_connection"""			,     """conv_shortcut"""       )

												_UpperCAmelCase      =			shave_segments(snake_case			,     n_shave_prefix_segments=snake_case       )

												mapping.append({"""old""": old_item, """new""": new_item}       )

						return mapping




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case=0       )						->				Union[str, Any]:
						_UpperCAmelCase      =			[]
						for old_item in old_list:
												_UpperCAmelCase      =			old_item

												_UpperCAmelCase      =			new_item.replace("""norm.weight"""			,     """group_norm.weight"""       )
												_UpperCAmelCase      =			new_item.replace("""norm.bias"""			,     """group_norm.bias"""       )

												_UpperCAmelCase      =			new_item.replace("""proj_out.weight"""			,     """proj_attn.weight"""       )
												_UpperCAmelCase      =			new_item.replace("""proj_out.bias"""			,     """proj_attn.bias"""       )

												_UpperCAmelCase      =			shave_segments(snake_case			,     n_shave_prefix_segments=snake_case       )

												mapping.append({"""old""": old_item, """new""": new_item}       )

						return mapping




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case			,     snake_case			,     snake_case=None			,     snake_case=None			,     snake_case=None       )						->				Optional[Any]:
						assert isinstance(snake_case			,     snake_case       ), "Paths should be a list of dicts containing 'old' and 'new' keys."

						# Splits the attention layers into three variables.
						if attention_paths_to_split is not None:
												for path, path_map in attention_paths_to_split.items():
																		_UpperCAmelCase      =			old_checkpoint[path]
																		_UpperCAmelCase      =			old_tensor.shape[0] // 3

																		_UpperCAmelCase      =			(-1, channels) if len(old_tensor.shape       ) == 3 else (-1)

																		_UpperCAmelCase      =			old_tensor.shape[0] // config["""num_head_channels"""] // 3

																		_UpperCAmelCase      =			old_tensor.reshape((num_heads, 3 * channels // num_heads) + old_tensor.shape[1:]       )
																		_UpperCAmelCase    ,					_UpperCAmelCase    ,					_UpperCAmelCase      =			old_tensor.split(channels // num_heads			,     dim=1       )

																		_UpperCAmelCase      =			query.reshape(snake_case       )
																		_UpperCAmelCase      =			key.reshape(snake_case       )
																		_UpperCAmelCase      =			value.reshape(snake_case       )

						for path in paths:
												_UpperCAmelCase      =			path["""new"""]

												# These have already been assigned
												if attention_paths_to_split is not None and new_path in attention_paths_to_split:
																		continue

												# Global renaming happens here
												_UpperCAmelCase      =			new_path.replace("""middle_block.0"""			,     """mid_block.resnets.0"""       )
												_UpperCAmelCase      =			new_path.replace("""middle_block.1"""			,     """mid_block.attentions.0"""       )
												_UpperCAmelCase      =			new_path.replace("""middle_block.2"""			,     """mid_block.resnets.1"""       )

												if additional_replacements is not None:
																		for replacement in additional_replacements:
																								_UpperCAmelCase      =			new_path.replace(replacement["""old"""]			,     replacement["""new"""]       )

        # proj_attn.weight has to be converted from conv 1D to linear
												if "proj_attn.weight" in new_path:
																		_UpperCAmelCase      =			old_checkpoint[path["""old"""]][:, :, 0]
												else:
																		_UpperCAmelCase      =			old_checkpoint[path["""old"""]]




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				int:
						_UpperCAmelCase      =			{}

						_UpperCAmelCase      =			checkpoint["""time_embed.0.weight"""]
						_UpperCAmelCase      =			checkpoint["""time_embed.0.bias"""]
						_UpperCAmelCase      =			checkpoint["""time_embed.2.weight"""]
						_UpperCAmelCase      =			checkpoint["""time_embed.2.bias"""]

						_UpperCAmelCase      =			checkpoint["""input_blocks.0.0.weight"""]
						_UpperCAmelCase      =			checkpoint["""input_blocks.0.0.bias"""]

						_UpperCAmelCase      =			checkpoint["""out.0.weight"""]
						_UpperCAmelCase      =			checkpoint["""out.0.bias"""]
						_UpperCAmelCase      =			checkpoint["""out.2.weight"""]
						_UpperCAmelCase      =			checkpoint["""out.2.bias"""]

						# Retrieves the keys for the input blocks only
						_UpperCAmelCase      =			len({""".""".join(layer.split("""."""       )[:2]       ) for layer in checkpoint if """input_blocks""" in layer}       )
						_UpperCAmelCase      =			{
						    layer_id: [key for key in checkpoint if f"input_blocks.{layer_id}" in key]
						    for layer_id in range(snake_case       )
						}

						# Retrieves the keys for the middle blocks only
						_UpperCAmelCase      =			len({""".""".join(layer.split("""."""       )[:2]       ) for layer in checkpoint if """middle_block""" in layer}       )
						_UpperCAmelCase      =			{
						    layer_id: [key for key in checkpoint if f"middle_block.{layer_id}" in key]
						    for layer_id in range(snake_case       )
						}

						# Retrieves the keys for the output blocks only
						_UpperCAmelCase      =			len({""".""".join(layer.split("""."""       )[:2]       ) for layer in checkpoint if """output_blocks""" in layer}       )
						_UpperCAmelCase      =			{
						    layer_id: [key for key in checkpoint if f"output_blocks.{layer_id}" in key]
						    for layer_id in range(snake_case       )
						}

						for i in range(1			,     snake_case       ):
												_UpperCAmelCase      =			(i - 1) // (config["""num_res_blocks"""] + 1)
												_UpperCAmelCase      =			(i - 1) % (config["""num_res_blocks"""] + 1)

												_UpperCAmelCase      =			[key for key in input_blocks[i] if f"input_blocks.{i}.0" in key]
												_UpperCAmelCase      =			[key for key in input_blocks[i] if f"input_blocks.{i}.1" in key]

												if f"input_blocks.{i}.0.op.weight" in checkpoint:
																		_UpperCAmelCase      =			checkpoint[
																		    f"input_blocks.{i}.0.op.weight"
																		]
																		_UpperCAmelCase      =			checkpoint[
																		    f"input_blocks.{i}.0.op.bias"
																		]
																		continue

												_UpperCAmelCase      =			renew_resnet_paths(snake_case       )
												_UpperCAmelCase      =			{"""old""": f"input_blocks.{i}.0", """new""": f"down_blocks.{block_id}.resnets.{layer_in_block_id}"}
												_UpperCAmelCase      =			{"""old""": """resnets.2.op""", """new""": """downsamplers.0.op"""}
												assign_to_checkpoint(
												    snake_case			,     snake_case			,     snake_case			,     additional_replacements=[meta_path, resnet_op]			,     config=snake_case       )

												if len(snake_case       ):
																		_UpperCAmelCase      =			renew_attention_paths(snake_case       )
																		_UpperCAmelCase      =			{
																		    """old""": f"input_blocks.{i}.1",
																		    """new""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}",
																		}
																		_UpperCAmelCase      =			{
																		    f"input_blocks.{i}.1.qkv.bias": {
																		        """key""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.key.bias",
																		        """query""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.query.bias",
																		        """value""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.value.bias",
																		    },
																		    f"input_blocks.{i}.1.qkv.weight": {
																		        """key""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.key.weight",
																		        """query""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.query.weight",
																		        """value""": f"down_blocks.{block_id}.attentions.{layer_in_block_id}.value.weight",
																		    },
																		}
																		assign_to_checkpoint(
																		    snake_case			,     snake_case			,     snake_case			,     additional_replacements=[meta_path]			,     attention_paths_to_split=snake_case			,     config=snake_case			,     )

						_UpperCAmelCase      =			middle_blocks[0]
						_UpperCAmelCase      =			middle_blocks[1]
						_UpperCAmelCase      =			middle_blocks[2]

						_UpperCAmelCase      =			renew_resnet_paths(snake_case       )
						assign_to_checkpoint(snake_case			,     snake_case			,     snake_case			,     config=snake_case       )

						_UpperCAmelCase      =			renew_resnet_paths(snake_case       )
						assign_to_checkpoint(snake_case			,     snake_case			,     snake_case			,     config=snake_case       )

						_UpperCAmelCase      =			renew_attention_paths(snake_case       )
						_UpperCAmelCase      =			{
						    """middle_block.1.qkv.bias""": {
						        """key""": """mid_block.attentions.0.key.bias""",
						        """query""": """mid_block.attentions.0.query.bias""",
						        """value""": """mid_block.attentions.0.value.bias""",
						    },
						    """middle_block.1.qkv.weight""": {
						        """key""": """mid_block.attentions.0.key.weight""",
						        """query""": """mid_block.attentions.0.query.weight""",
						        """value""": """mid_block.attentions.0.value.weight""",
						    },
						}
						assign_to_checkpoint(
						    snake_case			,     snake_case			,     snake_case			,     attention_paths_to_split=snake_case			,     config=snake_case       )

						for i in range(snake_case       ):
												_UpperCAmelCase      =			i // (config["""num_res_blocks"""] + 1)
												_UpperCAmelCase      =			i % (config["""num_res_blocks"""] + 1)
												_UpperCAmelCase      =			[shave_segments(snake_case			,     2       ) for name in output_blocks[i]]
												_UpperCAmelCase      =			{}

												for layer in output_block_layers:
																		_UpperCAmelCase    ,					_UpperCAmelCase      =			layer.split("""."""       )[0], shave_segments(snake_case			,     1       )
																		if layer_id in output_block_list:
																								output_block_list[layer_id].append(snake_case       )
																		else:
																								_UpperCAmelCase      =			[layer_name]

												if len(snake_case       ) > 1:
																		_UpperCAmelCase      =			[key for key in output_blocks[i] if f"output_blocks.{i}.0" in key]
																		_UpperCAmelCase      =			[key for key in output_blocks[i] if f"output_blocks.{i}.1" in key]

																		_UpperCAmelCase      =			renew_resnet_paths(snake_case       )
																		_UpperCAmelCase      =			renew_resnet_paths(snake_case       )

																		_UpperCAmelCase      =			{"""old""": f"output_blocks.{i}.0", """new""": f"up_blocks.{block_id}.resnets.{layer_in_block_id}"}
																		assign_to_checkpoint(snake_case			,     snake_case			,     snake_case			,     additional_replacements=[meta_path]			,     config=snake_case       )

																		if ["conv.weight", "conv.bias"] in output_block_list.values():
																								_UpperCAmelCase      =			list(output_block_list.values()       ).index(["""conv.weight""", """conv.bias"""]       )
																								_UpperCAmelCase      =			checkpoint[
																								    f"output_blocks.{i}.{index}.conv.weight"
																								]
																								_UpperCAmelCase      =			checkpoint[
																								    f"output_blocks.{i}.{index}.conv.bias"
																								]

																								# Clear attentions as they have been attributed above.
																								if len(snake_case       ) == 2:
																														_UpperCAmelCase      =			[]

																		if len(snake_case       ):
																								_UpperCAmelCase      =			renew_attention_paths(snake_case       )
																								_UpperCAmelCase      =			{
																								    """old""": f"output_blocks.{i}.1",
																								    """new""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}",
																								}
																								_UpperCAmelCase      =			{
																								    f"output_blocks.{i}.1.qkv.bias": {
																								        """key""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.key.bias",
																								        """query""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.query.bias",
																								        """value""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.value.bias",
																								    },
																								    f"output_blocks.{i}.1.qkv.weight": {
																								        """key""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.key.weight",
																								        """query""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.query.weight",
																								        """value""": f"up_blocks.{block_id}.attentions.{layer_in_block_id}.value.weight",
																								    },
																								}
																								assign_to_checkpoint(
																								    snake_case			,     snake_case			,     snake_case			,     additional_replacements=[meta_path]			,     attention_paths_to_split=to_split if any("""qkv""" in key for key in attentions       ) else None			,     config=snake_case			,     )
												else:
																		_UpperCAmelCase      =			renew_resnet_paths(snake_case			,     n_shave_prefix_segments=1       )
																		for path in resnet_0_paths:
																								_UpperCAmelCase      =			""".""".join(["""output_blocks""", str(snake_case       ), path["""old"""]]       )
																								_UpperCAmelCase      =			""".""".join(["""up_blocks""", str(snake_case       ), """resnets""", str(snake_case       ), path["""new"""]]       )

																								_UpperCAmelCase      =			checkpoint[old_path]

						return new_checkpoint


if __name__ == "__main__":
				a													=			argparse.ArgumentParser()

				parser.add_argument(
				    "--checkpoint_path", default=None, type=str, required=True, help="Path to the checkpoint to convert."
				)

				parser.add_argument(
				    "--config_file",
				    default=None,
				    type=str,
				    required=True,
				    help="The config json file corresponding to the architecture.",
				)

				parser.add_argument("--dump_path", default=None, type=str, required=True, help="Path to the output model.")

				a													=			parser.parse_args()

				a													=			torch.load(args.checkpoint_path)

				with open(args.config_file) as f:
								a													=			json.loads(f.read())

				a													=			convert_ldm_checkpoint(checkpoint, config)

				if "ldm" in config:
								del config["ldm"]

				a													=			UNetaDModel(**config)
				model.load_state_dict(converted_checkpoint)

				try:
								a													=			DDPMScheduler.from_config("/".join(args.checkpoint_path.split("/")[:-1]))
								a													=			VQModel.from_pretrained("/".join(args.checkpoint_path.split("/")[:-1]))

								a													=			LDMPipeline(unet=model, scheduler=scheduler, vae=vqvae)
								pipe.save_pretrained(args.dump_path)
				except:  # noqa: E722
								model.save_pretrained(args.dump_path)





import argparse

import fairseq
import torch

from transformers import UniSpeechSatConfig, UniSpeechSatForCTC, UniSpeechSatForPreTraining, logging


logging.set_verbosity_info()
a													=			logging.get_logger(__name__)

a													=			{
    "post_extract_proj": "feature_projection.projection",
    "encoder.pos_conv.0": "encoder.pos_conv_embed.conv",
    "self_attn.k_proj": "encoder.layers.*.attention.k_proj",
    "self_attn.v_proj": "encoder.layers.*.attention.v_proj",
    "self_attn.q_proj": "encoder.layers.*.attention.q_proj",
    "self_attn.out_proj": "encoder.layers.*.attention.out_proj",
    "self_attn_layer_norm": "encoder.layers.*.layer_norm",
    "fc1": "encoder.layers.*.feed_forward.intermediate_dense",
    "fc2": "encoder.layers.*.feed_forward.output_dense",
    "final_layer_norm": "encoder.layers.*.final_layer_norm",
    "encoder.layer_norm": "encoder.layer_norm",
    "encoder.layer_norm_for_extract": "layer_norm_for_extract",
    "w2v_model.layer_norm": "feature_projection.layer_norm",
    "quantizer.weight_proj": "quantizer.weight_proj",
    "quantizer.vars": "quantizer.codevectors",
    "project_q": "project_q",
    "final_proj": "project_hid",
    "w2v_encoder.proj": "lm_head",
    "label_embs_concat": "label_embeddings_concat",
    "mask_emb": "masked_spec_embed",
    "spk_proj": "speaker_proj",
}
a													=			[
    "lm_head",
    "quantizer.weight_proj",
    "quantizer.codevectors",
    "project_q",
    "project_hid",
    "label_embeddings_concat",
    "speaker_proj",
    "layer_norm_for_extract",
]




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case			,     snake_case			,     snake_case			,     snake_case       )						->				List[str]:
						for attribute in key.split("""."""       ):
												_UpperCAmelCase      =			getattr(snake_case			,     snake_case       )

						if weight_type is not None:
												_UpperCAmelCase      =			getattr(snake_case			,     snake_case       ).shape
						else:
												_UpperCAmelCase      =			hf_pointer.shape

						if hf_shape != value.shape:
												raise ValueError(
												    f"Shape of hf {key + '.' + weight_type if weight_type is not None else ''} is {hf_shape}, but should be"
												    f" {value.shape} for {full_name}"       )

						if weight_type == "weight":
												_UpperCAmelCase      =			value
						elif weight_type == "weight_g":
												_UpperCAmelCase      =			value
						elif weight_type == "weight_v":
												_UpperCAmelCase      =			value
						elif weight_type == "bias":
												_UpperCAmelCase      =			value
						else:
												_UpperCAmelCase      =			value

						logger.info(f"{key + '.' + weight_type if weight_type is not None else ''} was initialized from {full_name}."       )




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case       )						->				Optional[int]:
						_UpperCAmelCase      =			[]
						_UpperCAmelCase      =			fairseq_model.state_dict()

						_UpperCAmelCase      =			hf_model.unispeech_sat.feature_extractor

						for name, value in fairseq_dict.items():
												_UpperCAmelCase      =			False
												if "conv_layers" in name:
																		load_conv_layer(
																		    snake_case			,     snake_case			,     snake_case			,     snake_case			,     hf_model.config.feat_extract_norm == """group"""			,     )
																		_UpperCAmelCase      =			True
												else:
																		for key, mapped_key in MAPPING.items():
																								_UpperCAmelCase      =			"""unispeech_sat.""" + mapped_key if mapped_key not in TOP_LEVEL_KEYS else mapped_key
																								if key in name or key.split("""w2v_model."""       )[-1] == name.split("""."""       )[0]:
																														if "layer_norm_for_extract" in name and (".".join(name.split("""."""       )[:-1]       ) != key):
																																				# special case since naming is very similar
																																				continue
																														_UpperCAmelCase      =			True
																														if "*" in mapped_key:
																																				_UpperCAmelCase      =			name.split(snake_case       )[0].split("""."""       )[-2]
																																				_UpperCAmelCase      =			mapped_key.replace("""*"""			,     snake_case       )
																														if "weight_g" in name:
																																				_UpperCAmelCase      =			"""weight_g"""
																														elif "weight_v" in name:
																																				_UpperCAmelCase      =			"""weight_v"""
																														elif "bias" in name:
																																				_UpperCAmelCase      =			"""bias"""
																														elif "weight" in name:
																																				# TODO: don't match quantizer.weight_proj
																																				_UpperCAmelCase      =			"""weight"""
																														else:
																																				_UpperCAmelCase      =			None
																														set_recursively(snake_case			,     snake_case			,     snake_case			,     snake_case			,     snake_case       )
																								continue
												if not is_used:
																		unused_weights.append(snake_case       )

						logger.warning(f"Unused weights: {unused_weights}"       )




def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case			,     snake_case			,     snake_case			,     snake_case       )						->				str:
						_UpperCAmelCase      =			full_name.split("""conv_layers."""       )[-1]
						_UpperCAmelCase      =			name.split("""."""       )
						_UpperCAmelCase      =			int(items[0]       )
						_UpperCAmelCase      =			int(items[1]       )

						if type_id == 0:
												if "bias" in name:
																		if value.shape != feature_extractor.conv_layers[layer_id].conv.bias.data.shape:
																								raise ValueError(
																								    f"{full_name} has size {value.shape}, but"
																								    f" {feature_extractor.conv_layers[layer_id].conv.bias.data.shape} was found."       )
																		_UpperCAmelCase      =			value
																		logger.info(f"Feat extract conv layer {layer_id} was initialized from {full_name}."       )
												elif "weight" in name:
																		if value.shape != feature_extractor.conv_layers[layer_id].conv.weight.data.shape:
																								raise ValueError(
																								    f"{full_name} has size {value.shape}, but"
																								    f" {feature_extractor.conv_layers[layer_id].conv.weight.data.shape} was found."       )
																		_UpperCAmelCase      =			value
																		logger.info(f"Feat extract conv layer {layer_id} was initialized from {full_name}."       )
						elif (type_id == 2 and not use_group_norm) or (type_id == 2 and layer_id == 0 and use_group_norm):
												if "bias" in name:
																		if value.shape != feature_extractor.conv_layers[layer_id].layer_norm.bias.data.shape:
																								raise ValueError(
																								    f"{full_name} has size {value.shape}, but"
																								    f" {feature_extractor[layer_id].layer_norm.bias.data.shape} was found."       )
																		_UpperCAmelCase      =			value
																		logger.info(f"Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}."       )
												elif "weight" in name:
																		if value.shape != feature_extractor.conv_layers[layer_id].layer_norm.weight.data.shape:
																								raise ValueError(
																								    f"{full_name} has size {value.shape}, but"
																								    f" {feature_extractor[layer_id].layer_norm.weight.data.shape} was found."       )
																		_UpperCAmelCase      =			value
																		logger.info(f"Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}."       )
						else:
												unused_weights.append(snake_case       )




@torch.no_grad()
def        _SCREAMING_SNAKE_CASE      (		snake_case			,     snake_case			,     snake_case=None			,     snake_case=None			,     snake_case=True       )						->				List[Any]:
						if config_path is not None:
												_UpperCAmelCase      =			UniSpeechSatConfig.from_pretrained(snake_case       )
						else:
												_UpperCAmelCase      =			UniSpeechSatConfig()

						_UpperCAmelCase      =			""""""

						if is_finetuned:
												_UpperCAmelCase      =			UniSpeechSatForCTC(snake_case       )
						else:
												_UpperCAmelCase      =			UniSpeechSatForPreTraining(snake_case       )

						_UpperCAmelCase    ,					_UpperCAmelCase    ,					_UpperCAmelCase      =			fairseq.checkpoint_utils.load_model_ensemble_and_task(
						    [checkpoint_path]			,     arg_overrides={"""data""": """/""".join(dict_path.split("""/"""       )[:-1]       )}       )
						_UpperCAmelCase      =			model[0].eval()

						recursively_load_weights(snake_case			,     snake_case       )

						hf_wavavec.save_pretrained(snake_case       )


if __name__ == "__main__":
				a													=			argparse.ArgumentParser()
				parser.add_argument("--pytorch_dump_folder_path", default=None, type=str, help="Path to the output PyTorch model.")
				parser.add_argument("--checkpoint_path", default=None, type=str, help="Path to fairseq checkpoint")
				parser.add_argument("--dict_path", default=None, type=str, help="Path to dict of fine-tuned model")
				parser.add_argument("--config_path", default=None, type=str, help="Path to hf config.json of model to convert")
				parser.add_argument(
				    "--not_finetuned", action="store_true", help="Whether the model to convert is a fine-tuned model or not"
				)
				a													=			parser.parse_args()
				convert_unispeech_sat_checkpoint(
				    args.checkpoint_path, args.pytorch_dump_folder_path, args.config_path, args.dict_path, not args.not_finetuned
				)