import argparse
import json
import os

import fairseq
import torch
from fairseq.data import Dictionary

from transformers import (
    WavaVecaConfig,
    WavaVecaCTCTokenizer,
    WavaVecaFeatureExtractor,
    WavaVecaForCTC,
    WavaVecaForPreTraining,
    WavaVecaProcessor,
    logging,
)
from transformers.models.wavaveca.modeling_wavaveca import WavaVecaForSequenceClassification


logging.set_verbosity_info()
A     :  int					     =       logging.get_logger(__name__)

A     :  int					     =       {
    "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",
    "adapter_layer": "encoder.layers.*.adapter_layer",
    "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",
    "pooling_layer.linear": "projector",
    "pooling_layer.projection": "classifier",
}
A     :  str					     =       [
    "lm_head",
    "quantizer.weight_proj",
    "quantizer.codevectors",
    "project_q",
    "project_hid",
    "projector",
    "classifier",
]


def      a__ (		__UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  {}
      with open(snake_case__     ,      "r"				) as file:
            for line_number, line in enumerate(snake_case__				):
                  SCREAMING_SNAKE_CASE_          =  line.strip()
                  if line:
                        SCREAMING_SNAKE_CASE_          =  line.split()
                        SCREAMING_SNAKE_CASE_          =  line_number
                        SCREAMING_SNAKE_CASE_          =  words[0]
                        SCREAMING_SNAKE_CASE_          =  value
      return result


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      for attribute in key.split("."				):
            SCREAMING_SNAKE_CASE_          =  getattr(snake_case__     ,      snake_case__				)

      SCREAMING_SNAKE_CASE_          =  None
      for param_key in PARAM_MAPPING.keys():
            if full_name.endswith(snake_case__				):
                  SCREAMING_SNAKE_CASE_          =  PARAM_MAPPING[full_name.split("."				)[-1]]
                  SCREAMING_SNAKE_CASE_          =  "param"

      if weight_type is not None and weight_type != "param":
            SCREAMING_SNAKE_CASE_          =  getattr(snake_case__     ,      snake_case__				).shape
      elif weight_type is not None and weight_type == "param":
            SCREAMING_SNAKE_CASE_          =  hf_pointer
            for attribute in hf_param_name.split("."				):
                  SCREAMING_SNAKE_CASE_          =  getattr(snake_case__     ,      snake_case__				)
            SCREAMING_SNAKE_CASE_          =  shape_pointer.shape

            # let's reduce dimension
            SCREAMING_SNAKE_CASE_          =  value[0]
      else:
            SCREAMING_SNAKE_CASE_          =  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":
            SCREAMING_SNAKE_CASE_          =  value
      elif weight_type == "weight_g":
            SCREAMING_SNAKE_CASE_          =  value
      elif weight_type == "weight_v":
            SCREAMING_SNAKE_CASE_          =  value
      elif weight_type == "bias":
            SCREAMING_SNAKE_CASE_          =  value
      elif weight_type == "param":
            for attribute in hf_param_name.split("."				):
                  SCREAMING_SNAKE_CASE_          =  getattr(snake_case__     ,      snake_case__				)
            SCREAMING_SNAKE_CASE_          =  value
      else:
            SCREAMING_SNAKE_CASE_          =  value

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


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  None
      for param_key in PARAM_MAPPING.keys():
            if full_name.endswith(snake_case__				):
                  SCREAMING_SNAKE_CASE_          =  PARAM_MAPPING[full_name.split("."				)[-1]]
                  SCREAMING_SNAKE_CASE_          =  "param"

      if weight_type is not None and weight_type != "param":
            SCREAMING_SNAKE_CASE_          =  ".".join([key, weight_type]				)
      elif weight_type is not None and weight_type == "param":
            SCREAMING_SNAKE_CASE_          =  ".".join([key, hf_param_name]				)
      else:
            SCREAMING_SNAKE_CASE_          =  key

      SCREAMING_SNAKE_CASE_          =  value if "lm_head" in full_key else value[0]


A     :  Dict					     =       {
    "W_a": "linear_1.weight",
    "W_b": "linear_2.weight",
    "b_a": "linear_1.bias",
    "b_b": "linear_2.bias",
    "ln_W": "norm.weight",
    "ln_b": "norm.bias",
}


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase=None     ,      __UpperCamelCase=None				):
      SCREAMING_SNAKE_CASE_          =  False
      for key, mapped_key in MAPPING.items():
            SCREAMING_SNAKE_CASE_          =  "wav2vec2." + 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]:
                  SCREAMING_SNAKE_CASE_          =  True
                  if "*" in mapped_key:
                        SCREAMING_SNAKE_CASE_          =  name.split(snake_case__				)[0].split("."				)[-2]
                        SCREAMING_SNAKE_CASE_          =  mapped_key.replace("*"     ,      snake_case__				)
                  if "weight_g" in name:
                        SCREAMING_SNAKE_CASE_          =  "weight_g"
                  elif "weight_v" in name:
                        SCREAMING_SNAKE_CASE_          =  "weight_v"
                  elif "bias" in name:
                        SCREAMING_SNAKE_CASE_          =  "bias"
                  elif "weight" in name:
                        # TODO: don't match quantizer.weight_proj
                        SCREAMING_SNAKE_CASE_          =  "weight"
                  else:
                        SCREAMING_SNAKE_CASE_          =  None
                  if hf_dict is not None:
                        rename_dict(snake_case__     ,      snake_case__     ,      snake_case__     ,      snake_case__     ,      snake_case__				)
                  else:
                        set_recursively(snake_case__     ,      snake_case__     ,      snake_case__     ,      snake_case__     ,      snake_case__				)
                  return is_used
      return is_used


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  []
      SCREAMING_SNAKE_CASE_          =  fairseq_model.state_dict()

      SCREAMING_SNAKE_CASE_          =  hf_model.wavaveca.feature_extractor

      for name, value in fairseq_dict.items():
            SCREAMING_SNAKE_CASE_          =  False
            if "conv_layers" in name:
                  load_conv_layer(
                      snake_case__     ,      snake_case__     ,      snake_case__     ,      snake_case__     ,      hf_model.config.feat_extract_norm == "group"     ,      )
                  SCREAMING_SNAKE_CASE_          =  True
            else:
                  SCREAMING_SNAKE_CASE_          =  load_wavaveca_layer(snake_case__     ,      snake_case__     ,      snake_case__				)
            if not is_used:
                  unused_weights.append(snake_case__				)

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


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  full_name.split("conv_layers."				)[-1]
      SCREAMING_SNAKE_CASE_          =  name.split("."				)
      SCREAMING_SNAKE_CASE_          =  int(items[0]				)
      SCREAMING_SNAKE_CASE_          =  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.'''				)
                  SCREAMING_SNAKE_CASE_          =  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.'''				)
                  SCREAMING_SNAKE_CASE_          =  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.'''				)
                  SCREAMING_SNAKE_CASE_          =  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.'''				)
                  SCREAMING_SNAKE_CASE_          =  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      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase=None     ,      __UpperCamelCase=None     ,      __UpperCamelCase=True     ,      __UpperCamelCase=False				):
      if config_path is not None:
            SCREAMING_SNAKE_CASE_          =  WavaVecaConfig.from_pretrained(snake_case__				)
      else:
            SCREAMING_SNAKE_CASE_          =  WavaVecaConfig()

      if is_seq_class:
            SCREAMING_SNAKE_CASE_          =  read_txt_into_dict(snake_case__				)
            SCREAMING_SNAKE_CASE_          =  idalabel
            SCREAMING_SNAKE_CASE_          =  WavaVecaForSequenceClassification(snake_case__				)
            SCREAMING_SNAKE_CASE_          =  WavaVecaFeatureExtractor(
                feature_size=1     ,      sampling_rate=1_6_0_0_0     ,      padding_value=0     ,      do_normalize=snake_case__     ,      return_attention_mask=snake_case__     ,      )
            feature_extractor.save_pretrained(snake_case__				)

      elif is_finetuned:
            if dict_path:
                  SCREAMING_SNAKE_CASE_          =  Dictionary.load(snake_case__				)

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

                  # fairseq has the <pad> and <s> switched
                  SCREAMING_SNAKE_CASE_          =  0
                  SCREAMING_SNAKE_CASE_          =  1
                  with open(snake_case__     ,      "w"     ,      encoding="utf-8"				) as vocab_handle:
                        json.dump(snake_case__     ,      snake_case__				)
                  SCREAMING_SNAKE_CASE_          =  WavaVecaCTCTokenizer(
                      snake_case__     ,      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=snake_case__     ,      )
                  SCREAMING_SNAKE_CASE_          =  True if config.feat_extract_norm == "layer" else False
                  SCREAMING_SNAKE_CASE_          =  WavaVecaFeatureExtractor(
                      feature_size=1     ,      sampling_rate=1_6_0_0_0     ,      padding_value=0     ,      do_normalize=snake_case__     ,      return_attention_mask=snake_case__     ,      )
                  SCREAMING_SNAKE_CASE_          =  WavaVecaProcessor(feature_extractor=snake_case__     ,      tokenizer=snake_case__				)
                  processor.save_pretrained(snake_case__				)

            SCREAMING_SNAKE_CASE_          =  WavaVecaForCTC(snake_case__				)
      else:
            SCREAMING_SNAKE_CASE_          =  WavaVecaForPreTraining(snake_case__				)

      if is_finetuned or is_seq_class:
            SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_          =  fairseq.checkpoint_utils.load_model_ensemble_and_task(
                [checkpoint_path]     ,      arg_overrides={"data": "/".join(dict_path.split("/"				)[:-1]				)}				)
      else:
            SCREAMING_SNAKE_CASE_          =  argparse.Namespace(task="audio_pretraining"				)
            SCREAMING_SNAKE_CASE_          =  fairseq.tasks.setup_task(snake_case__				)

            SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_     , SCREAMING_SNAKE_CASE_          =  fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_path]     ,      task=snake_case__				)

      SCREAMING_SNAKE_CASE_          =  model[0].eval()

      recursively_load_weights(snake_case__     ,      snake_case__     ,      not is_finetuned				)

      hf_wavavec.save_pretrained(snake_case__				)


if __name__ == "__main__":
   A     :  Tuple					     =       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"
   )
   parser.add_argument(
       "--is_seq_class",
       action="store_true",
       help="Whether the model to convert is a fine-tuned sequence classification model or not",
   )
   A     :  Any					     =       parser.parse_args()

   A     :  List[Any]					     =       not args.not_finetuned and not args.is_seq_class
   convert_wavaveca_checkpoint(
       args.checkpoint_path,
       args.pytorch_dump_folder_path,
       args.config_path,
       args.dict_path,
       is_finetuned,
       args.is_seq_class,
   )



import argparse
import json
from pathlib import Path

import requests
import torch
from huggingface_hub import hf_hub_download
from PIL import Image

from transformers import (
    SwiftFormerConfig,
    SwiftFormerForImageClassification,
    ViTImageProcessor,
)
from transformers.utils import logging


logging.set_verbosity_info()
A     :  Optional[Any]					     =       logging.get_logger(__name__)

A     :  List[Any]					     =       torch.device("cpu")


def      a__ (		):
      SCREAMING_SNAKE_CASE_          =  "http://images.cocodataset.org/val2017/000000039769.jpg"
      SCREAMING_SNAKE_CASE_          =  Image.open(requests.get(__UpperCamelCase     ,      stream=__UpperCamelCase				).raw				)
      return im


def      a__ (		__UpperCamelCase				):
      if swiftformer_name == "swiftformer_xs":
            return torch.tensor([-2.1_703E00, 2.1_107E00, -2.0_811E00, 8.8_685E-01, 2.4_360E-01]				)

      elif swiftformer_name == "swiftformer_s":
            return torch.tensor([3.9_636E-01, 2.3_478E-01, -1.6_963E00, -1.7_381E00, -8.6_337E-01]				)

      elif swiftformer_name == "swiftformer_l1":
            return torch.tensor([-4.2_768E-01, -4.7_429E-01, -1.0_897E00, -1.0_248E00, 3.5_523E-02]				)

      elif swiftformer_name == "swiftformer_l3":
            return torch.tensor([-2.5_330E-01, 2.4_211E-01, -6.0_185E-01, -8.2_789E-01, -6.0_446E-02]				)


def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  dct.pop(__UpperCamelCase				)
      SCREAMING_SNAKE_CASE_          =  val


def      a__ (		__UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  []
      for k in state_dict.keys():
            SCREAMING_SNAKE_CASE_          =  k
            if ".pwconv" in k:
                  SCREAMING_SNAKE_CASE_          =  k_new.replace(".pwconv"     ,      ".point_wise_conv"				)
            if ".dwconv" in k:
                  SCREAMING_SNAKE_CASE_          =  k_new.replace(".dwconv"     ,      ".depth_wise_conv"				)
            if ".Proj." in k:
                  SCREAMING_SNAKE_CASE_          =  k_new.replace(".Proj."     ,      ".proj."				)
            if "patch_embed" in k_new:
                  SCREAMING_SNAKE_CASE_          =  k_new.replace("patch_embed"     ,      "swiftformer.patch_embed.patch_embedding"				)
            if "network" in k_new:
                  SCREAMING_SNAKE_CASE_          =  k_new.split("."				)
                  if ls[2].isdigit():
                        SCREAMING_SNAKE_CASE_          =  "swiftformer.encoder.network." + ls[1] + ".blocks." + ls[2] + "." + ".".join(ls[3:]				)
                  else:
                        SCREAMING_SNAKE_CASE_          =  k_new.replace("network"     ,      "swiftformer.encoder.network"				)
            rename_keys.append((k, k_new)				)
      return rename_keys


@torch.no_grad()
def      a__ (		__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				):
      SCREAMING_SNAKE_CASE_          =  SwiftFormerConfig()

      # dataset (ImageNet-21k only or also fine-tuned on ImageNet 2012), patch_size and image_size
      SCREAMING_SNAKE_CASE_          =  1_0_0_0
      SCREAMING_SNAKE_CASE_          =  "huggingface/label-files"
      SCREAMING_SNAKE_CASE_          =  "imagenet-1k-id2label.json"
      SCREAMING_SNAKE_CASE_          =  json.load(open(hf_hub_download(__UpperCamelCase     ,      __UpperCamelCase     ,      repo_type="dataset"				)     ,      "r"				)				)
      SCREAMING_SNAKE_CASE_          =  {int(__UpperCamelCase				): v for k, v in idalabel.items()}
      SCREAMING_SNAKE_CASE_          =  idalabel
      SCREAMING_SNAKE_CASE_          =  {v: k for k, v in idalabel.items()}

      # size of the architecture
      if swiftformer_name == "swiftformer_xs":
            SCREAMING_SNAKE_CASE_          =  [3, 3, 6, 4]
            SCREAMING_SNAKE_CASE_          =  [4_8, 5_6, 1_1_2, 2_2_0]

      elif swiftformer_name == "swiftformer_s":
            SCREAMING_SNAKE_CASE_          =  [3, 3, 9, 6]
            SCREAMING_SNAKE_CASE_          =  [4_8, 6_4, 1_6_8, 2_2_4]

      elif swiftformer_name == "swiftformer_l1":
            SCREAMING_SNAKE_CASE_          =  [4, 3, 1_0, 5]
            SCREAMING_SNAKE_CASE_          =  [4_8, 9_6, 1_9_2, 3_8_4]

      elif swiftformer_name == "swiftformer_l3":
            SCREAMING_SNAKE_CASE_          =  [4, 4, 1_2, 6]
            SCREAMING_SNAKE_CASE_          =  [6_4, 1_2_8, 3_2_0, 5_1_2]

      # load state_dict of original model, remove and rename some keys
      if original_ckpt:
            if original_ckpt.startswith("https"				):
                  SCREAMING_SNAKE_CASE_          =  torch.hub.load_state_dict_from_url(__UpperCamelCase     ,      map_location="cpu"     ,      check_hash=__UpperCamelCase				)
            else:
                  SCREAMING_SNAKE_CASE_          =  torch.load(__UpperCamelCase     ,      map_location="cpu"				)
      SCREAMING_SNAKE_CASE_          =  checkpoint

      SCREAMING_SNAKE_CASE_          =  create_rename_keys(__UpperCamelCase				)
      for rename_key_src, rename_key_dest in rename_keys:
            rename_key(__UpperCamelCase     ,      __UpperCamelCase     ,      __UpperCamelCase				)

      # load HuggingFace model
      SCREAMING_SNAKE_CASE_          =  SwiftFormerForImageClassification(__UpperCamelCase				).eval()
      hf_model.load_state_dict(__UpperCamelCase				)

      # prepare test inputs
      SCREAMING_SNAKE_CASE_          =  prepare_img()
      SCREAMING_SNAKE_CASE_          =  ViTImageProcessor.from_pretrained("preprocessor_config"				)
      SCREAMING_SNAKE_CASE_          =  processor(images=__UpperCamelCase     ,      return_tensors="pt"				)

      # compare outputs from both models
      SCREAMING_SNAKE_CASE_          =  get_expected_output(__UpperCamelCase				)
      SCREAMING_SNAKE_CASE_          =  hf_model(inputs["pixel_values"]				).logits

      assert hf_logits.shape == torch.Size([1, 1_0_0_0]				)
      assert torch.allclose(hf_logits[0, 0:5]     ,      __UpperCamelCase     ,      atol=1E-3				)

      Path(__UpperCamelCase				).mkdir(exist_ok=__UpperCamelCase				)
      print(F'''Saving model {swiftformer_name} to {pytorch_dump_folder_path}'''				)
      hf_model.save_pretrained(__UpperCamelCase				)


if __name__ == "__main__":
      A     :  Optional[Any]					     =       argparse.ArgumentParser()
      # Required parameters
      parser.add_argument(
          "--swiftformer_name",
          default="swiftformer_xs",
          choices=["swiftformer_xs", "swiftformer_s", "swiftformer_l1", "swiftformer_l3"],
          type=str,
          help="Name of the SwiftFormer model you'd like to convert.",
      )
      parser.add_argument(
          "--pytorch_dump_folder_path",
          default="./converted_outputs/",
          type=str,
          help="Path to the output PyTorch model directory.",
      )
      parser.add_argument("--original_ckpt", default=None, type=str, help="Path to the original model checkpoint.")

      A     :  List[Any]					     =       parser.parse_args()
      convert_swiftformer_checkpoint(args.swiftformer_name, args.pytorch_dump_folder_path, args.original_ckpt)


