
"""simple docstring"""






import argparse
from pathlib import Path

import fairseq
import torch
from fairseq.models.xmod import XMODModel as FairseqXmodModel
from packaging import version

from transformers import XmodConfig, XmodForMaskedLM, XmodForSequenceClassification
from transformers.utils import logging


if version.parse(fairseq.__version__) < version.parse('0.12.2'):
 raise Exception('requires fairseq >= 0.12.2')
if version.parse(fairseq.__version__) > version.parse('2'):
 raise Exception('requires fairseq < v2')

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

__SCREAMING_SNAKE_CASE							=     'Hello, World!'
__SCREAMING_SNAKE_CASE							=     'en_XX'




def       A_  (				__lowercase						,	__lowercase						,	__lowercase	):
 UpperCamelCase_     :					List[str]   	=Path('data_bin'	)
 UpperCamelCase_     :					int   	=FairseqXmodModel.from_pretrained(
     model_name_or_path=str(Path(__lowercase	).parent	)						,	checkpoint_file=Path(__lowercase	).name						,	_name='xmod_base'						,	arch='xmod_base'						,	task='multilingual_masked_lm'						,	data_name_or_path=str(__lowercase	)						,	bpe='sentencepiece'						,	sentencepiece_model=str(Path(__lowercase	).parent / 'sentencepiece.bpe.model'	)						,	src_dict=str(data_dir / 'dict.txt'	)						,	)
 xmod.eval()  # disable dropout
 print(__lowercase	)

 UpperCamelCase_     :					Dict   	=xmod.model.encoder.sentence_encoder
 UpperCamelCase_     :					List[Any]   	=XmodConfig(
     vocab_size=xmod_sent_encoder.embed_tokens.num_embeddings						,	hidden_size=xmod.cfg.model.encoder_embed_dim						,	num_hidden_layers=xmod.cfg.model.encoder_layers						,	num_attention_heads=xmod.cfg.model.encoder_attention_heads						,	intermediate_size=xmod.cfg.model.encoder_ffn_embed_dim						,	max_position_embeddings=5_14						,	type_vocab_size=1						,	layer_norm_eps=1e-5						,	pre_norm=xmod.cfg.model.encoder_normalize_before						,	adapter_reduction_factor=getattr(xmod.cfg.model						,	'bottleneck'						,	2	)						,	adapter_layer_norm=xmod.cfg.model.adapter_layer_norm						,	adapter_reuse_layer_norm=xmod.cfg.model.adapter_reuse_layer_norm						,	ln_before_adapter=xmod.cfg.model.ln_before_adapter						,	languages=xmod.cfg.model.languages						,	)
 if classification_head:
  UpperCamelCase_     :					Tuple   	=xmod.model.classification_heads['mnli'].out_proj.weight.shape[0]

 print('Our X-MOD config:'						,	__lowercase	)

 UpperCamelCase_     :					int   	=XmodForSequenceClassification(__lowercase	) if classification_head else XmodForMaskedLM(__lowercase	)
 model.eval()

 # Now let's copy all the weights.
 # Embeddings
 UpperCamelCase_     :					Dict   	=xmod_sent_encoder.embed_tokens.weight
 UpperCamelCase_     :					Union[str, Any]   	=xmod_sent_encoder.embed_positions.weight
 UpperCamelCase_     :					int   	=torch.zeros_like(
     model.roberta.embeddings.token_type_embeddings.weight	)  # just zero them out b/c xmod doesn't use them.

 UpperCamelCase_     :					Any   	=xmod_sent_encoder.layernorm_embedding.weight
 UpperCamelCase_     :					List[str]   	=xmod_sent_encoder.layernorm_embedding.bias

 for i in range(config.num_hidden_layers	):
  # Encoder: start of layer
  UpperCamelCase_     :					Tuple   	=model.roberta.encoder.layer[i]
  UpperCamelCase_     :					Union[str, Any]   	=xmod_sent_encoder.layers[i]

  # self attention
  UpperCamelCase_     :					Tuple   	=layer.attention.self
  if not (
      xmod_layer.self_attn.k_proj.weight.data.shape
      == xmod_layer.self_attn.q_proj.weight.data.shape
      == xmod_layer.self_attn.v_proj.weight.data.shape
      == torch.Size((config.hidden_size, config.hidden_size)	)
  ):
   raise AssertionError('Dimensions of self-attention weights do not match.'	)

  UpperCamelCase_     :					int   	=xmod_layer.self_attn.q_proj.weight
  UpperCamelCase_     :					Dict   	=xmod_layer.self_attn.q_proj.bias
  UpperCamelCase_     :					Any   	=xmod_layer.self_attn.k_proj.weight
  UpperCamelCase_     :					List[str]   	=xmod_layer.self_attn.k_proj.bias
  UpperCamelCase_     :					List[Any]   	=xmod_layer.self_attn.v_proj.weight
  UpperCamelCase_     :					Any   	=xmod_layer.self_attn.v_proj.bias

  # self-attention output
  UpperCamelCase_     :					str   	=layer.attention.output
  if self_output.dense.weight.shape != xmod_layer.self_attn.out_proj.weight.shape:
   raise AssertionError('Dimensions of self-attention output weights do not match.'	)
  UpperCamelCase_     :					Union[str, Any]   	=xmod_layer.self_attn.out_proj.weight
  UpperCamelCase_     :					List[str]   	=xmod_layer.self_attn.out_proj.bias
  UpperCamelCase_     :					Dict   	=xmod_layer.self_attn_layer_norm.weight
  UpperCamelCase_     :					Tuple   	=xmod_layer.self_attn_layer_norm.bias

  # intermediate
  UpperCamelCase_     :					Tuple   	=layer.intermediate
  if intermediate.dense.weight.shape != xmod_layer.fca.weight.shape:
   raise AssertionError('Dimensions of intermediate weights do not match.'	)
  UpperCamelCase_     :					int   	=xmod_layer.fca.weight
  UpperCamelCase_     :					Tuple   	=xmod_layer.fca.bias

  # output
  UpperCamelCase_     :					int   	=layer.output
  if bert_output.dense.weight.shape != xmod_layer.fca.weight.shape:
   raise AssertionError('Dimensions of feed-forward weights do not match.'	)
  UpperCamelCase_     :					List[str]   	=xmod_layer.fca.weight
  UpperCamelCase_     :					Optional[int]   	=xmod_layer.fca.bias
  UpperCamelCase_     :					Any   	=xmod_layer.final_layer_norm.weight
  UpperCamelCase_     :					Optional[Any]   	=xmod_layer.final_layer_norm.bias
  if bert_output.adapter_layer_norm is not None:
   UpperCamelCase_     :					List[Any]   	=xmod_layer.adapter_layer_norm.weight
   UpperCamelCase_     :					str   	=xmod_layer.adapter_layer_norm.bias

  if sorted(bert_output.adapter_modules.keys()	) != sorted(xmod_layer.adapter_modules.keys()	):
   raise AssertionError('Lists of language adapters do not match.'	)
  for lang_code, adapter in xmod_layer.adapter_modules.items():
   UpperCamelCase_     :					Tuple   	=bert_output.adapter_modules[lang_code]
   UpperCamelCase_     :					Optional[int]   	=xmod_layer.adapter_modules[lang_code]
   UpperCamelCase_     :					Union[str, Any]   	=from_adapter.fca.weight
   UpperCamelCase_     :					Optional[int]   	=from_adapter.fca.bias
   UpperCamelCase_     :					Tuple   	=from_adapter.fca.weight
   UpperCamelCase_     :					Optional[Any]   	=from_adapter.fca.bias

  # end of layer

 if xmod_sent_encoder.layer_norm is not None:
  UpperCamelCase_     :					str   	=xmod_sent_encoder.layer_norm.weight
  UpperCamelCase_     :					Any   	=xmod_sent_encoder.layer_norm.bias

 if classification_head:
  UpperCamelCase_     :					Optional[Any]   	=xmod.model.classification_heads['mnli'].dense.weight
  UpperCamelCase_     :					Tuple   	=xmod.model.classification_heads['mnli'].dense.bias
  UpperCamelCase_     :					Optional[Any]   	=xmod.model.classification_heads['mnli'].out_proj.weight
  UpperCamelCase_     :					Optional[int]   	=xmod.model.classification_heads['mnli'].out_proj.bias
 else:
  # LM Head
  UpperCamelCase_     :					Dict   	=xmod.model.encoder.lm_head.dense.weight
  UpperCamelCase_     :					Any   	=xmod.model.encoder.lm_head.dense.bias
  UpperCamelCase_     :					List[str]   	=xmod.model.encoder.lm_head.layer_norm.weight
  UpperCamelCase_     :					Union[str, Any]   	=xmod.model.encoder.lm_head.layer_norm.bias
  UpperCamelCase_     :					int   	=xmod.model.encoder.lm_head.weight
  UpperCamelCase_     :					int   	=xmod.model.encoder.lm_head.bias

 # Let's check that we get the same results.
 UpperCamelCase_     :					Tuple   	=xmod.encode(__lowercase	).unsqueeze(0	)  # batch of size 1
 model.roberta.set_default_language(__lowercase	)

 UpperCamelCase_     :					Tuple   	=model(__lowercase	)[0]
 if classification_head:
  UpperCamelCase_     :					str   	=xmod.model.classification_heads['mnli'](xmod.extract_features(__lowercase	)	)
 else:
  UpperCamelCase_     :					Union[str, Any]   	=xmod.model(__lowercase						,	lang_id=[SAMPLE_LANGUAGE]	)[0]
 print(our_output.shape						,	their_output.shape	)
 UpperCamelCase_     :					int   	=torch.max(torch.abs(our_output - their_output	)	).item()
 print(F'''max_absolute_diff = {max_absolute_diff}'''	)  # ~ 1e-7
 UpperCamelCase_     :					Union[str, Any]   	=torch.allclose(__lowercase						,	__lowercase						,	atol=1e-3	)
 print('Do both models output the same tensors?'						,	'🔥' if success else '💩'	)
 if not success:
  raise Exception('Something went wRoNg'	)

 Path(__lowercase	).mkdir(parents=__lowercase						,	exist_ok=__lowercase	)
 print(F'''Saving model to {pytorch_dump_folder_path}'''	)
 model.save_pretrained(__lowercase	)


if __name__ == "__main__":
 __SCREAMING_SNAKE_CASE							=     argparse.ArgumentParser()
 # Required parameters
 parser.add_argument(
     '--xmod_checkpoint_path', default=None, type=str, required=True, help='Path the official PyTorch dump.'
 )
 parser.add_argument(
     '--pytorch_dump_folder_path', default=None, type=str, required=True, help='Path to the output PyTorch model.'
 )
 parser.add_argument(
     '--classification_head', action='store_true', help='Whether to convert a final classification head.'
 )
 __SCREAMING_SNAKE_CASE							=     parser.parse_args()
 convert_xmod_checkpoint_to_pytorch(
     args.xmod_checkpoint_path, args.pytorch_dump_folder_path, args.classification_head
 )


"""simple docstring"""






import argparse
import math
import os
from copy import deepcopy

import torch
from audio_diffusion.models import DiffusionAttnUnetaD
from diffusion import sampling
from torch import nn

from diffusers import DanceDiffusionPipeline, IPNDMScheduler, UNetaDModel


__SCREAMING_SNAKE_CASE							=     {
    'gwf-440k': {
        'url': 'https://model-server.zqevans2.workers.dev/gwf-440k.ckpt',
        'sample_rate': 48_000,
        'sample_size': 65_536,
    },
    'jmann-small-190k': {
        'url': 'https://model-server.zqevans2.workers.dev/jmann-small-190k.ckpt',
        'sample_rate': 48_000,
        'sample_size': 65_536,
    },
    'jmann-large-580k': {
        'url': 'https://model-server.zqevans2.workers.dev/jmann-large-580k.ckpt',
        'sample_rate': 48_000,
        'sample_size': 131_072,
    },
    'maestro-uncond-150k': {
        'url': 'https://model-server.zqevans2.workers.dev/maestro-uncond-150k.ckpt',
        'sample_rate': 16_000,
        'sample_size': 65_536,
    },
    'unlocked-uncond-250k': {
        'url': 'https://model-server.zqevans2.workers.dev/unlocked-uncond-250k.ckpt',
        'sample_rate': 16_000,
        'sample_size': 65_536,
    },
    'honk-140k': {
        'url': 'https://model-server.zqevans2.workers.dev/honk-140k.ckpt',
        'sample_rate': 16_000,
        'sample_size': 65_536,
    },
}




def       A_  (				__lowercase						,	__lowercase	):
 return torch.atana(__lowercase						,	__lowercase	) / math.pi * 2




def       A_  (				__lowercase	):
 UpperCamelCase_     :					Dict   	=torch.sin(t * math.pi / 2	) ** 2
 UpperCamelCase_     :					Union[str, Any]   	=(1 - sigma**2) ** 0.5
 return alpha_sigma_to_t(__lowercase						,	__lowercase	)





class 				a__					(						A__       ):
     pass





class 				a__					(						nn.Module       ):



     def __init__(							self :Any      ,  _lowerCamelCase :Tuple   ):







      '''simple docstring'''



      super().__init__()

      UpperCamelCase_     :					Optional[int]   	=DiffusionAttnUnetaD(_lowerCamelCase      ,  n_attn_layers=4   )
      UpperCamelCase_     :					List[str]   	=deepcopy(self.diffusion   )
      UpperCamelCase_     :					int   	=torch.quasirandom.SobolEngine(1      ,  scramble=_lowerCamelCase   )




def       A_  (				__lowercase	):
 UpperCamelCase_     :					List[str]   	=MODELS_MAP[model_name]['url']
 os.system(F'''wget {url} ./'''	)

 return F'''./{model_name}.ckpt'''


__SCREAMING_SNAKE_CASE							=     {
    '1': 'resnets.0',
    '2': 'attentions.0',
    '3': 'resnets.1',
    '4': 'attentions.1',
    '5': 'resnets.2',
    '6': 'attentions.2',
}
__SCREAMING_SNAKE_CASE							=     {
    '8': 'resnets.0',
    '9': 'attentions.0',
    '10': 'resnets.1',
    '11': 'attentions.1',
    '12': 'resnets.2',
    '13': 'attentions.2',
}
__SCREAMING_SNAKE_CASE							=     {
    '1': 'resnets.0',
    '2': 'attentions.0',
    '3': 'resnets.1',
    '4': 'attentions.1',
    '5': 'resnets.2',
    '6': 'attentions.2',
    '8': 'resnets.3',
    '9': 'attentions.3',
    '10': 'resnets.4',
    '11': 'attentions.4',
    '12': 'resnets.5',
    '13': 'attentions.5',
}
__SCREAMING_SNAKE_CASE							=     {
    '0': 'resnets.0',
    '1': 'resnets.1',
    '2': 'resnets.2',
    '4': 'resnets.0',
    '5': 'resnets.1',
    '6': 'resnets.2',
}

__SCREAMING_SNAKE_CASE							=     {
    'skip': 'conv_skip',
    'main.0': 'conv_1',
    'main.1': 'group_norm_1',
    'main.3': 'conv_2',
    'main.4': 'group_norm_2',
}

__SCREAMING_SNAKE_CASE							=     {
    'norm': 'group_norm',
    'qkv_proj': ['query', 'key', 'value'],
    'out_proj': ['proj_attn'],
}




def       A_  (				__lowercase	):
 if name.startswith('skip'	):
  return name.replace('skip'						,	RES_CONV_MAP['skip']	)

 # name has to be of format main.{digit}
 if not name.startswith('main.'	):
  raise ValueError(F'''ResConvBlock error with {name}'''	)

 return name.replace(name[:6]						,	RES_CONV_MAP[name[:6]]	)




def       A_  (				__lowercase	):
 for key, value in ATTN_MAP.items():
  if name.startswith(__lowercase	) and not isinstance(__lowercase						,	__lowercase	):
   return name.replace(__lowercase						,	__lowercase	)
  elif name.startswith(__lowercase	):
   return [name.replace(__lowercase						,	__lowercase	) for v in value]
 raise ValueError(F'''Attn error with {name}'''	)




def       A_  (				__lowercase						,	__lowercase=13	):
 UpperCamelCase_     :					Optional[Any]   	=input_string

 if string.split('.'	)[0] == "timestep_embed":
  return string.replace('timestep_embed'						,	'time_proj'	)

 UpperCamelCase_     :					Tuple   	=0
 if string.startswith('net.3.'	):
  depth += 1
  UpperCamelCase_     :					str   	=string[6:]
 elif string.startswith('net.'	):
  UpperCamelCase_     :					List[str]   	=string[4:]

 while string.startswith('main.7.'	):
  depth += 1
  UpperCamelCase_     :					Optional[int]   	=string[7:]

 if string.startswith('main.'	):
  UpperCamelCase_     :					Union[str, Any]   	=string[5:]

 # mid block
 if string[:2].isdigit():
  UpperCamelCase_     :					List[str]   	=string[:2]
  UpperCamelCase_     :					Any   	=string[2:]
 else:
  UpperCamelCase_     :					List[Any]   	=string[0]
  UpperCamelCase_     :					Tuple   	=string[1:]

 if depth == max_depth:
  UpperCamelCase_     :					Optional[Any]   	=MID_NUM_TO_LAYER[layer_num]
  UpperCamelCase_     :					Optional[int]   	='mid_block'
 elif depth > 0 and int(__lowercase	) < 7:
  UpperCamelCase_     :					int   	=DOWN_NUM_TO_LAYER[layer_num]
  UpperCamelCase_     :					Dict   	=F'''down_blocks.{depth}'''
 elif depth > 0 and int(__lowercase	) > 7:
  UpperCamelCase_     :					Optional[Any]   	=UP_NUM_TO_LAYER[layer_num]
  UpperCamelCase_     :					Tuple   	=F'''up_blocks.{max_depth - depth - 1}'''
 elif depth == 0:
  UpperCamelCase_     :					Optional[int]   	=DEPTH_0_TO_LAYER[layer_num]
  UpperCamelCase_     :					List[str]   	=F'''up_blocks.{max_depth - 1}''' if int(__lowercase	) > 3 else 'down_blocks.0'

 if not string_left.startswith('.'	):
  raise ValueError(F'''Naming error with {input_string} and string_left: {string_left}.'''	)

 UpperCamelCase_     :					Union[str, Any]   	=string_left[1:]

 if "resnets" in new_layer:
  UpperCamelCase_     :					Dict   	=convert_resconv_naming(__lowercase	)
 elif "attentions" in new_layer:
  UpperCamelCase_     :					List[Any]   	=convert_attn_naming(__lowercase	)
  UpperCamelCase_     :					str   	=new_string_left

 if not isinstance(__lowercase						,	__lowercase	):
  UpperCamelCase_     :					int   	=prefix + '.' + new_layer + '.' + string_left
 else:
  UpperCamelCase_     :					List[Any]   	=[prefix + '.' + new_layer + '.' + s for s in string_left]
 return new_string




def       A_  (				__lowercase	):
 UpperCamelCase_     :					Union[str, Any]   	={}
 for k, v in state_dict.items():
  if k.endswith('kernel'	):
   # up- and downsample layers, don't have trainable weights
   continue

  UpperCamelCase_     :					Optional[Any]   	=rename(__lowercase	)

  # check if we need to transform from Conv => Linear for attention
  if isinstance(__lowercase						,	__lowercase	):
   UpperCamelCase_     :					Union[str, Any]   	=transform_conv_attns(__lowercase						,	__lowercase						,	__lowercase	)
  else:
   UpperCamelCase_     :					Union[str, Any]   	=v

 return new_state_dict




def       A_  (				__lowercase						,	__lowercase						,	__lowercase	):
 if len(__lowercase	) == 1:
  if len(v.shape	) == 3:
   # weight
   UpperCamelCase_     :					Tuple   	=v[:, :, 0]
  else:
   # bias
   UpperCamelCase_     :					Any   	=v
 else:
  # qkv matrices
  UpperCamelCase_     :					Tuple   	=v.shape[0]
  UpperCamelCase_     :					Optional[Any]   	=trippled_shape // 3
  for i in range(3	):
   if len(v.shape	) == 3:
    UpperCamelCase_     :					str   	=v[i * single_shape : (i + 1) * single_shape, :, 0]
   else:
    UpperCamelCase_     :					List[str]   	=v[i * single_shape : (i + 1) * single_shape]
 return new_state_dict




def       A_  (				__lowercase	):
 UpperCamelCase_     :					int   	=torch.device('cuda' if torch.cuda.is_available() else 'cpu'	)

 UpperCamelCase_     :					Dict   	=args.model_path.split('/'	)[-1].split('.'	)[0]
 if not os.path.isfile(args.model_path	):
  assert (
      model_name == args.model_path
  ), F'''Make sure to provide one of the official model names {MODELS_MAP.keys()}'''
  UpperCamelCase_     :					Optional[Any]   	=download(__lowercase	)

 UpperCamelCase_     :					str   	=MODELS_MAP[model_name]['sample_rate']
 UpperCamelCase_     :					Any   	=MODELS_MAP[model_name]['sample_size']

 UpperCamelCase_     :					str   	=Object()
 UpperCamelCase_     :					List[str]   	=sample_size
 UpperCamelCase_     :					Optional[int]   	=sample_rate
 UpperCamelCase_     :					Tuple   	=0

 UpperCamelCase_     :					Optional[int]   	=UNetaDModel(sample_size=__lowercase						,	sample_rate=__lowercase	)
 UpperCamelCase_     :					Union[str, Any]   	=diffusers_model.state_dict()

 UpperCamelCase_     :					Any   	=DiffusionUncond(__lowercase	)
 orig_model.load_state_dict(torch.load(args.model_path						,	map_location=__lowercase	)['state_dict']	)
 UpperCamelCase_     :					List[str]   	=orig_model.diffusion_ema.eval()
 UpperCamelCase_     :					Tuple   	=orig_model.state_dict()
 UpperCamelCase_     :					Optional[int]   	=rename_orig_weights(__lowercase	)

 UpperCamelCase_     :					Any   	=set(renamed_state_dict.keys()	) - set(diffusers_state_dict.keys()	)
 UpperCamelCase_     :					Tuple   	=set(diffusers_state_dict.keys()	) - set(renamed_state_dict.keys()	)

 assert len(__lowercase	) == 0, F'''Problem with {renamed_minus_diffusers}'''
 assert all(k.endswith('kernel'	) for k in list(__lowercase	)	), F'''Problem with {diffusers_minus_renamed}'''

 for key, value in renamed_state_dict.items():
  assert (
      diffusers_state_dict[key].squeeze().shape == value.squeeze().shape
  ), F'''Shape for {key} doesn\'t match. Diffusers: {diffusers_state_dict[key].shape} vs. {value.shape}'''
  if key == "time_proj.weight":
   UpperCamelCase_     :					List[str]   	=value.squeeze()

  UpperCamelCase_     :					str   	=value

 diffusers_model.load_state_dict(__lowercase	)

 UpperCamelCase_     :					Optional[Any]   	=1_00
 UpperCamelCase_     :					List[str]   	=33

 UpperCamelCase_     :					Any   	=IPNDMScheduler(num_train_timesteps=__lowercase	)

 UpperCamelCase_     :					List[Any]   	=torch.manual_seed(__lowercase	)
 UpperCamelCase_     :					List[str]   	=torch.randn([1, 2, config.sample_size]						,	generator=__lowercase	).to(__lowercase	)

 UpperCamelCase_     :					str   	=torch.linspace(1						,	0						,	steps + 1						,	device=__lowercase	)[:-1]
 UpperCamelCase_     :					Dict   	=get_crash_schedule(__lowercase	)

 UpperCamelCase_     :					Optional[Any]   	=DanceDiffusionPipeline(unet=__lowercase						,	scheduler=__lowercase	)

 UpperCamelCase_     :					Optional[Any]   	=torch.manual_seed(33	)
 UpperCamelCase_     :					Optional[Any]   	=pipe(num_inference_steps=__lowercase						,	generator=__lowercase	).audios

 UpperCamelCase_     :					Dict   	=sampling.iplms_sample(__lowercase						,	__lowercase						,	__lowercase						,	{}	)
 UpperCamelCase_     :					List[Any]   	=generated.clamp(-1						,	1	)

 UpperCamelCase_     :					Optional[int]   	=(generated - audio).abs().sum()
 UpperCamelCase_     :					Union[str, Any]   	=(generated - audio).abs().max()

 if args.save:
  pipe.save_pretrained(args.checkpoint_path	)

 print('Diff sum'						,	__lowercase	)
 print('Diff max'						,	__lowercase	)

 assert diff_max < 1e-3, F'''Diff max: {diff_max} is too much :-/'''

 print(F'''Conversion for {model_name} successful!'''	)


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

 parser.add_argument('--model_path', default=None, type=str, required=True, help='Path to the model to convert.')
 parser.add_argument(
     '--save', default=True, type=bool, required=False, help='Whether to save the converted model or not.'
 )
 parser.add_argument('--checkpoint_path', default=None, type=str, required=True, help='Path to the output model.')
 __SCREAMING_SNAKE_CASE							=     parser.parse_args()

 main(args)
