



'''simple docstring'''





import argparse
import json
import os

import fairseq
import torch
from fairseq.data import Dictionary

from transformers import (
    WavaVecaConformerConfig,
    WavaVecaConformerForCTC,
    WavaVecaConformerForPreTraining,
    WavaVecaCTCTokenizer,
    WavaVecaFeatureExtractor,
    WavaVecaProcessor,
    logging,
)


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

_UpperCamelCase											=						{
    'post_extract_proj': 'feature_projection.projection',
    'encoder.pos_conv.0': 'encoder.pos_conv_embed.conv',
    'self_attn.linear_k': 'encoder.layers.*.self_attn.linear_k',
    'self_attn.linear_v': 'encoder.layers.*.self_attn.linear_v',
    'self_attn.linear_q': 'encoder.layers.*.self_attn.linear_q',
    'self_attn.pos_bias_u': 'encoder.layers.*.self_attn.pos_bias_u',
    'self_attn.pos_bias_v': 'encoder.layers.*.self_attn.pos_bias_v',
    'self_attn.linear_out': 'encoder.layers.*.self_attn.linear_out',
    'self_attn.linear_pos': 'encoder.layers.*.self_attn.linear_pos',
    'self_attn.rotary_emb': 'encoder.embed_positions',
    'self_attn_layer_norm': 'encoder.layers.*.self_attn_layer_norm',
    'conv_module.pointwise_conv1': 'encoder.layers.*.conv_module.pointwise_conv1',
    'conv_module.pointwise_conv2': 'encoder.layers.*.conv_module.pointwise_conv2',
    'conv_module.depthwise_conv': 'encoder.layers.*.conv_module.depthwise_conv',
    'conv_module.batch_norm': 'encoder.layers.*.conv_module.batch_norm',
    'conv_module.layer_norm': 'encoder.layers.*.conv_module.layer_norm',
    'ffn1.w_1': 'encoder.layers.*.ffn1.intermediate_dense',
    'ffn1.w_2': 'encoder.layers.*.ffn1.output_dense',
    'ffn1.layer_norm': 'encoder.layers.*.ffn1_layer_norm',
    'ffn2.w_1': 'encoder.layers.*.ffn2.intermediate_dense',
    'ffn2.w_2': 'encoder.layers.*.ffn2.output_dense',
    'ffn2.layer_norm': 'encoder.layers.*.ffn2_layer_norm',
    'final_layer_norm': 'encoder.layers.*.final_layer_norm',
    'encoder.layer_norm': 'encoder.layer_norm',
    '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',
    'mask_emb': 'masked_spec_embed',
}
_UpperCamelCase											=						[
    'lm_head',
    'quantizer.weight_proj',
    'quantizer.codevectors',
    'project_q',
    'project_hid',
]

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Optional[int]:
  for attribute in key.split('.'       ):
    __lowerCamelCase       :       Union[str, Any]           = getattr(_lowerCAmelCase       ,_lowerCAmelCase       )

  if weight_type is not None:
    __lowerCamelCase       :       Any           = getattr(_lowerCAmelCase       ,_lowerCAmelCase       ).shape
  else:
    __lowerCamelCase       :       Tuple           = 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":
    __lowerCamelCase       :       Union[str, Any]           = value
  elif weight_type == "weight_g":
    __lowerCamelCase       :       Any           = value
  elif weight_type == "weight_v":
    __lowerCamelCase       :       Optional[Any]           = value
  elif weight_type == "bias":
    __lowerCamelCase       :       List[Any]           = value
  elif weight_type == "running_mean":
    __lowerCamelCase       :       Tuple           = value
  elif weight_type == "running_var":
    __lowerCamelCase       :       Union[str, Any]           = value
  elif weight_type == "num_batches_tracked":
    __lowerCamelCase       :       str           = value
  elif weight_type == "inv_freq":
    __lowerCamelCase       :       Tuple           = value
  else:
    __lowerCamelCase       :       Tuple           = value

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

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Tuple:
  __lowerCamelCase       :       List[str]           = []
  __lowerCamelCase       :       Union[str, Any]           = fairseq_model.state_dict()

  __lowerCamelCase       :       List[str]           = hf_model.wavaveca_conformer.feature_extractor

  for name, value in fairseq_dict.items():
    __lowerCamelCase       :       int           = False
    if "conv_layers" in name:
      load_conv_layer(
          _lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,hf_model.config.feat_extract_norm == 'group'       ,)
      __lowerCamelCase       :       Optional[int]           = True
    else:
      for key, mapped_key in MAPPING.items():
        __lowerCamelCase       :       List[Any]           = 'wav2vec2_conformer.' + 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]:
          __lowerCamelCase       :       int           = True
          if "*" in mapped_key:
            __lowerCamelCase       :       List[str]           = name.split(_lowerCAmelCase       )[0].split('.'       )[-2]
            __lowerCamelCase       :       Union[str, Any]           = mapped_key.replace('*'       ,_lowerCAmelCase       )
          if "pos_bias_u" in name:
            __lowerCamelCase       :       Any           = None
          elif "pos_bias_v" in name:
            __lowerCamelCase       :       Optional[int]           = None
          elif "weight_g" in name:
            __lowerCamelCase       :       List[Any]           = 'weight_g'
          elif "weight_v" in name:
            __lowerCamelCase       :       Tuple           = 'weight_v'
          elif "bias" in name:
            __lowerCamelCase       :       List[Any]           = 'bias'
          elif "weight" in name:
            # TODO: don't match quantizer.weight_proj
            __lowerCamelCase       :       Union[str, Any]           = 'weight'
          elif "running_mean" in name:
            __lowerCamelCase       :       Optional[Any]           = 'running_mean'
          elif "inv_freq" in name:
            __lowerCamelCase       :       Any           = 'inv_freq'
          elif "running_var" in name:
            __lowerCamelCase       :       int           = 'running_var'
          elif "num_batches_tracked" in name:
            __lowerCamelCase       :       List[str]           = 'num_batches_tracked'
          else:
            __lowerCamelCase       :       List[str]           = None
          set_recursively(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       )
        continue
    if not is_used:
      unused_weights.append(_lowerCAmelCase       )

  logger.warning(F'Unused weights: {unused_weights}'       )

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       )      ->      List[Any]:
  __lowerCamelCase       :       str           = full_name.split('conv_layers.'       )[-1]
  __lowerCamelCase       :       List[str]           = name.split('.'       )
  __lowerCamelCase       :       List[str]           = int(items[0]       )
  __lowerCamelCase       :       int           = 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.'       )
      __lowerCamelCase       :       Any           = 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.'       )
      __lowerCamelCase       :       Tuple           = 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.conv_layers[layer_id].layer_norm.bias.data.shape} was found.'       )
      __lowerCamelCase       :       Optional[int]           = 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.conv_layers[layer_id].layer_norm.weight.data.shape} was found.'       )
      __lowerCamelCase       :       str           = value
      logger.info(F'Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.'       )
  else:
    unused_weights.append(_lowerCAmelCase       )

@torch.no_grad()
def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase=None       ,_lowerCAmelCase=None       ,_lowerCAmelCase=True       )      ->      Optional[Any]:
  if config_path is not None:
    __lowerCamelCase       :       List[Any]           = WavaVecaConformerConfig.from_pretrained(_lowerCAmelCase       ,hidden_act='swish'       )
  else:
    __lowerCamelCase       :       Optional[Any]           = WavaVecaConformerConfig()

  if "rope" in checkpoint_path:
    __lowerCamelCase       :       List[Any]           = 'rotary'

  if is_finetuned:
    if dict_path:
      __lowerCamelCase       :       Optional[Any]           = Dictionary.load(_lowerCAmelCase       )

      # important change bos & pad token id since CTC symbol is <pad> and
      # not <s> as in fairseq
      __lowerCamelCase       :       Union[str, Any]           = target_dict.pad_index
      __lowerCamelCase       :       str           = target_dict.bos_index
      __lowerCamelCase       :       Optional[Any]           = target_dict.eos_index
      __lowerCamelCase       :       str           = len(target_dict.symbols       )
      __lowerCamelCase       :       List[str]           = os.path.join(_lowerCAmelCase       ,'vocab.json'       )
      if not os.path.isdir(_lowerCAmelCase       ):
        logger.error('--pytorch_dump_folder_path ({}) should be a directory'.format(_lowerCAmelCase       )       )
        return
      os.makedirs(_lowerCAmelCase       ,exist_ok=_lowerCAmelCase       )
      __lowerCamelCase       :       List[str]           = target_dict.indices

      # fairseq has the <pad> and <s> switched
      __lowerCamelCase       :       Optional[Any]           = 0
      __lowerCamelCase       :       Optional[Any]           = 1
      with open(_lowerCAmelCase       ,'w'       ,encoding='utf-8'       ) as vocab_handle:
        json.dump(_lowerCAmelCase       ,_lowerCAmelCase       )
      __lowerCamelCase       :       Optional[int]           = WavaVecaCTCTokenizer(
          _lowerCAmelCase       ,unk_token=target_dict.unk_word       ,pad_token=target_dict.pad_word       ,bos_token=target_dict.bos_word       ,eos_token=target_dict.eos_word       ,word_delimiter_token='|'       ,do_lower_case=_lowerCAmelCase       ,)
      __lowerCamelCase       :       Any           = True if config.feat_extract_norm == 'layer' else False
      __lowerCamelCase       :       List[str]           = WavaVecaFeatureExtractor(
          feature_size=1       ,sampling_rate=16000       ,padding_value=0       ,do_normalize=_lowerCAmelCase       ,return_attention_mask=_lowerCAmelCase       ,)
      __lowerCamelCase       :       int           = WavaVecaProcessor(feature_extractor=_lowerCAmelCase       ,tokenizer=_lowerCAmelCase       )
      processor.save_pretrained(_lowerCAmelCase       )

    __lowerCamelCase       :       Optional[int]           = WavaVecaConformerForCTC(_lowerCAmelCase       )
  else:
    __lowerCamelCase       :       int           = WavaVecaConformerForPreTraining(_lowerCAmelCase       )

  if is_finetuned:
    __lowerCamelCase       ,__lowerCamelCase       ,__lowerCamelCase       :       Union[str, Any]           = fairseq.checkpoint_utils.load_model_ensemble_and_task(
        [checkpoint_path]       ,arg_overrides={'data': '/'.join(dict_path.split('/'       )[:-1]       )}       )
  else:
    __lowerCamelCase       :       List[str]           = argparse.Namespace(task='audio_pretraining'       )
    __lowerCamelCase       :       Union[str, Any]           = fairseq.tasks.setup_task(_lowerCAmelCase       )

    __lowerCamelCase       ,__lowerCamelCase       ,__lowerCamelCase       :       List[Any]           = fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_path]       ,task=_lowerCAmelCase       )

  __lowerCamelCase       :       Optional[int]           = model[0].eval()

  recursively_load_weights(_lowerCAmelCase       ,_lowerCAmelCase       ,not is_finetuned       )

  hf_wavavec.save_pretrained(_lowerCAmelCase       )


if __name__ == "__main__":
   _UpperCamelCase											=						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'
   )
   _UpperCamelCase											=						parser.parse_args()
   convert_wavaveca_conformer_checkpoint(
       args.checkpoint_path, args.pytorch_dump_folder_path, args.config_path, args.dict_path, not args.not_finetuned
   )











'''simple docstring'''





import argparse
import io

import requests
import torch
from omegaconf import OmegaConf

from diffusers import AutoencoderKL
from diffusers.pipelines.stable_diffusion.convert_from_ckpt import (
    assign_to_checkpoint,
    conv_attn_to_linear,
    create_vae_diffusers_config,
    renew_vae_attention_paths,
    renew_vae_resnet_paths,
)

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       )      ->      Dict:
  __lowerCamelCase       :       Any           = checkpoint

  __lowerCamelCase       :       List[str]           = {}

  __lowerCamelCase       :       List[str]           = vae_state_dict['encoder.conv_in.weight']
  __lowerCamelCase       :       Dict           = vae_state_dict['encoder.conv_in.bias']
  __lowerCamelCase       :       Optional[Any]           = vae_state_dict['encoder.conv_out.weight']
  __lowerCamelCase       :       Optional[int]           = vae_state_dict['encoder.conv_out.bias']
  __lowerCamelCase       :       Optional[int]           = vae_state_dict['encoder.norm_out.weight']
  __lowerCamelCase       :       Optional[int]           = vae_state_dict['encoder.norm_out.bias']

  __lowerCamelCase       :       Dict           = vae_state_dict['decoder.conv_in.weight']
  __lowerCamelCase       :       List[str]           = vae_state_dict['decoder.conv_in.bias']
  __lowerCamelCase       :       Tuple           = vae_state_dict['decoder.conv_out.weight']
  __lowerCamelCase       :       List[str]           = vae_state_dict['decoder.conv_out.bias']
  __lowerCamelCase       :       Dict           = vae_state_dict['decoder.norm_out.weight']
  __lowerCamelCase       :       Union[str, Any]           = vae_state_dict['decoder.norm_out.bias']

  __lowerCamelCase       :       Any           = vae_state_dict['quant_conv.weight']
  __lowerCamelCase       :       Union[str, Any]           = vae_state_dict['quant_conv.bias']
  __lowerCamelCase       :       Tuple           = vae_state_dict['post_quant_conv.weight']
  __lowerCamelCase       :       List[Any]           = vae_state_dict['post_quant_conv.bias']

  # Retrieves the keys for the encoder down blocks only
  __lowerCamelCase       :       str           = len({'.'.join(layer.split('.'       )[:3]       ) for layer in vae_state_dict if 'encoder.down' in layer}       )
  __lowerCamelCase       :       int           = {
      layer_id: [key for key in vae_state_dict if F'down.{layer_id}' in key] for layer_id in range(_lowerCAmelCase       )
  }

  # Retrieves the keys for the decoder up blocks only
  __lowerCamelCase       :       Dict           = len({'.'.join(layer.split('.'       )[:3]       ) for layer in vae_state_dict if 'decoder.up' in layer}       )
  __lowerCamelCase       :       Dict           = {
      layer_id: [key for key in vae_state_dict if F'up.{layer_id}' in key] for layer_id in range(_lowerCAmelCase       )
  }

  for i in range(_lowerCAmelCase       ):
    __lowerCamelCase       :       List[str]           = [key for key in down_blocks[i] if F'down.{i}' in key and F'down.{i}.downsample' not in key]

    if F'encoder.down.{i}.downsample.conv.weight' in vae_state_dict:
      __lowerCamelCase       :       Any           = vae_state_dict.pop(
          F'encoder.down.{i}.downsample.conv.weight'       )
      __lowerCamelCase       :       Any           = vae_state_dict.pop(
          F'encoder.down.{i}.downsample.conv.bias'       )

    __lowerCamelCase       :       Optional[int]           = renew_vae_resnet_paths(_lowerCAmelCase       )
    __lowerCamelCase       :       Any           = {'old': F'down.{i}.block', 'new': F'down_blocks.{i}.resnets'}
    assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )

  __lowerCamelCase       :       List[Any]           = [key for key in vae_state_dict if 'encoder.mid.block' in key]
  __lowerCamelCase       :       str           = 2
  for i in range(1       ,num_mid_res_blocks + 1       ):
    __lowerCamelCase       :       int           = [key for key in mid_resnets if F'encoder.mid.block_{i}' in key]

    __lowerCamelCase       :       Optional[Any]           = renew_vae_resnet_paths(_lowerCAmelCase       )
    __lowerCamelCase       :       Dict           = {'old': F'mid.block_{i}', 'new': F'mid_block.resnets.{i - 1}'}
    assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )

  __lowerCamelCase       :       Optional[Any]           = [key for key in vae_state_dict if 'encoder.mid.attn' in key]
  __lowerCamelCase       :       int           = renew_vae_attention_paths(_lowerCAmelCase       )
  __lowerCamelCase       :       Optional[Any]           = {'old': 'mid.attn_1', 'new': 'mid_block.attentions.0'}
  assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )
  conv_attn_to_linear(_lowerCAmelCase       )

  for i in range(_lowerCAmelCase       ):
    __lowerCamelCase       :       Optional[Any]           = num_up_blocks - 1 - i
    __lowerCamelCase       :       Any           = [
        key for key in up_blocks[block_id] if F'up.{block_id}' in key and F'up.{block_id}.upsample' not in key
    ]

    if F'decoder.up.{block_id}.upsample.conv.weight' in vae_state_dict:
      __lowerCamelCase       :       Optional[int]           = vae_state_dict[
          F'decoder.up.{block_id}.upsample.conv.weight'
      ]
      __lowerCamelCase       :       Optional[Any]           = vae_state_dict[
          F'decoder.up.{block_id}.upsample.conv.bias'
      ]

    __lowerCamelCase       :       Tuple           = renew_vae_resnet_paths(_lowerCAmelCase       )
    __lowerCamelCase       :       Any           = {'old': F'up.{block_id}.block', 'new': F'up_blocks.{i}.resnets'}
    assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )

  __lowerCamelCase       :       Optional[Any]           = [key for key in vae_state_dict if 'decoder.mid.block' in key]
  __lowerCamelCase       :       Union[str, Any]           = 2
  for i in range(1       ,num_mid_res_blocks + 1       ):
    __lowerCamelCase       :       List[str]           = [key for key in mid_resnets if F'decoder.mid.block_{i}' in key]

    __lowerCamelCase       :       str           = renew_vae_resnet_paths(_lowerCAmelCase       )
    __lowerCamelCase       :       Any           = {'old': F'mid.block_{i}', 'new': F'mid_block.resnets.{i - 1}'}
    assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )

  __lowerCamelCase       :       Any           = [key for key in vae_state_dict if 'decoder.mid.attn' in key]
  __lowerCamelCase       :       List[str]           = renew_vae_attention_paths(_lowerCAmelCase       )
  __lowerCamelCase       :       Optional[Any]           = {'old': 'mid.attn_1', 'new': 'mid_block.attentions.0'}
  assign_to_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       ,_lowerCAmelCase       ,additional_replacements=[meta_path]       ,config=_lowerCAmelCase       )
  conv_attn_to_linear(_lowerCAmelCase       )
  return new_checkpoint

def        a_     (							_lowerCAmelCase       ,_lowerCAmelCase       ,)      ->      List[Any]:
  # Only support V1
  __lowerCamelCase       :       Any           = requests.get(
      ' https://raw.githubusercontent.com/CompVis/stable-diffusion/main/configs/stable-diffusion/v1-inference.yaml'       )
  __lowerCamelCase       :       str           = io.BytesIO(r.content       )

  __lowerCamelCase       :       Any           = OmegaConf.load(_lowerCAmelCase       )
  __lowerCamelCase       :       List[Any]           = 512
  __lowerCamelCase       :       Dict           = 'cuda' if torch.cuda.is_available() else 'cpu'
  if checkpoint_path.endswith('safetensors'       ):
    from safetensors import safe_open

    __lowerCamelCase       :       Optional[Any]           = {}
    with safe_open(_lowerCAmelCase       ,framework='pt'       ,device='cpu'       ) as f:
      for key in f.keys():
        __lowerCamelCase       :       int           = f.get_tensor(_lowerCAmelCase       )
  else:
    __lowerCamelCase       :       int           = torch.load(_lowerCAmelCase       ,map_location=_lowerCAmelCase       )['state_dict']

  # Convert the VAE model.
  __lowerCamelCase       :       int           = create_vae_diffusers_config(_lowerCAmelCase       ,image_size=_lowerCAmelCase       )
  __lowerCamelCase       :       int           = custom_convert_ldm_vae_checkpoint(_lowerCAmelCase       ,_lowerCAmelCase       )

  __lowerCamelCase       :       Any           = AutoencoderKL(**_lowerCAmelCase       )
  vae.load_state_dict(_lowerCAmelCase       )
  vae.save_pretrained(_lowerCAmelCase       )


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

   parser.add_argument('--vae_pt_path', default=None, type=str, required=True, help='Path to the VAE.pt to convert.')
   parser.add_argument('--dump_path', default=None, type=str, required=True, help='Path to the VAE.pt to convert.')

   _UpperCamelCase											=						parser.parse_args()

   vae_pt_to_vae_diffuser(args.vae_pt_path, args.dump_path)






