






import argparse
import os
from pathlib import Path

import torch
from bark.generation import _load_model as _bark_load_model
from huggingface_hub import hf_hub_download

from transformers import EncodecConfig, EncodecModel, set_seed
from transformers.models.bark.configuration_bark import (
    BarkCoarseConfig,
    BarkConfig,
    BarkFineConfig,
    BarkSemanticConfig,
)
from transformers.models.bark.generation_configuration_bark import (
    BarkCoarseGenerationConfig,
    BarkFineGenerationConfig,
    BarkGenerationConfig,
    BarkSemanticGenerationConfig,
)
from transformers.models.bark.modeling_bark import BarkCoarseModel, BarkFineModel, BarkModel, BarkSemanticModel
from transformers.utils import logging


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

set_seed(7_70)


__snake_case				   =    {
    """c_attn""": """att_proj""",
    """c_proj""": """out_proj""",
    """c_fc""": """in_proj""",
    """transformer.""": """""",
    """h.""": """layers.""",
    """ln_1""": """layernorm_1""",
    """ln_2""": """layernorm_2""",
    """ln_f""": """layernorm_final""",
    """wpe""": """position_embeds_layer""",
    """wte""": """input_embeds_layer""",
}


__snake_case				   =    {
    """text_small""": {
        """repo_id""": """suno/bark""",
        """file_name""": """text.pt""",
    },
    """coarse_small""": {
        """repo_id""": """suno/bark""",
        """file_name""": """coarse.pt""",
    },
    """fine_small""": {
        """repo_id""": """suno/bark""",
        """file_name""": """fine.pt""",
    },
    """text""": {
        """repo_id""": """suno/bark""",
        """file_name""": """text_2.pt""",
    },
    """coarse""": {
        """repo_id""": """suno/bark""",
        """file_name""": """coarse_2.pt""",
    },
    """fine""": {
        """repo_id""": """suno/bark""",
        """file_name""": """fine_2.pt""",
    },
}

__snake_case				   =    os.path.dirname(os.path.abspath(__file__))
__snake_case				   =    os.path.join(os.path.expanduser("""~"""), """.cache""")
__snake_case				   =    os.path.join(os.getenv("""XDG_CACHE_HOME""", default_cache_dir), """suno""", """bark_v0""")


def     _A  (							SCREAMING_SNAKE_CASE__    :      List[Any]	,    SCREAMING_SNAKE_CASE__    :      List[Any]=False			):
    UpperCamelCase			:str      				=  model_type
    if use_small:
        key += "_small"
    return os.path.join(SCREAMING_SNAKE_CASE__	,    REMOTE_MODEL_PATHS[key]['''file_name''']			)


def     _A  (							SCREAMING_SNAKE_CASE__    :      Dict	,    SCREAMING_SNAKE_CASE__    :      List[Any]			):
    os.makedirs(SCREAMING_SNAKE_CASE__	,    exist_ok=SCREAMING_SNAKE_CASE__			)
    hf_hub_download(repo_id=SCREAMING_SNAKE_CASE__	,    filename=SCREAMING_SNAKE_CASE__	,    local_dir=SCREAMING_SNAKE_CASE__			)


def     _A  (							SCREAMING_SNAKE_CASE__    :      Tuple	,    SCREAMING_SNAKE_CASE__    :      int	,    SCREAMING_SNAKE_CASE__    :      Optional[Any]=False	,    SCREAMING_SNAKE_CASE__    :      Dict="text"			):
    if model_type == "text":
        UpperCamelCase			:Any      				=  BarkSemanticModel
        UpperCamelCase			:Optional[int]      				=  BarkSemanticConfig
        UpperCamelCase			:Dict      				=  BarkSemanticGenerationConfig
    elif model_type == "coarse":
        UpperCamelCase			:List[str]      				=  BarkCoarseModel
        UpperCamelCase			:Tuple      				=  BarkCoarseConfig
        UpperCamelCase			:Optional[int]      				=  BarkCoarseGenerationConfig
    elif model_type == "fine":
        UpperCamelCase			:Optional[int]      				=  BarkFineModel
        UpperCamelCase			:Tuple      				=  BarkFineConfig
        UpperCamelCase			:int      				=  BarkFineGenerationConfig
    else:
        raise NotImplementedError()
    UpperCamelCase			:Any      				=  F'''{model_type}_small''' if use_small else model_type
    UpperCamelCase			:Optional[int]      				=  REMOTE_MODEL_PATHS[model_key]
    if not os.path.exists(SCREAMING_SNAKE_CASE__			):
        logger.info(F'''{model_type} model not found, downloading into `{CACHE_DIR}`.'''			)
        _download(model_info['''repo_id''']	,    model_info['''file_name''']			)
    UpperCamelCase			:List[Any]      				=  torch.load(SCREAMING_SNAKE_CASE__	,    map_location=SCREAMING_SNAKE_CASE__			)
    # this is a hack
    UpperCamelCase			:Dict      				=  checkpoint["model_args"]
    if "input_vocab_size" not in model_args:
        UpperCamelCase			:str      				=  model_args["vocab_size"]
        UpperCamelCase			:List[str]      				=  model_args["vocab_size"]
        del model_args["vocab_size"]

    # convert Bark model arguments to HF Bark model arguments
    UpperCamelCase			:Dict      				=  model_args.pop('''n_head'''			)
    UpperCamelCase			:Tuple      				=  model_args.pop('''n_embd'''			)
    UpperCamelCase			:List[str]      				=  model_args.pop('''n_layer'''			)

    UpperCamelCase			:List[str]      				=  ConfigClass(**checkpoint['''model_args''']			)
    UpperCamelCase			:Optional[Any]      				=  ModelClass(config=SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:Union[str, Any]      				=  GenerationConfigClass()

    UpperCamelCase			:List[Any]      				=  model_generation_config
    UpperCamelCase			:str      				=  checkpoint["model"]
    # fixup checkpoint
    UpperCamelCase			:Optional[Any]      				=  "_orig_mod."
    for k, v in list(state_dict.items()			):
        if k.startswith(SCREAMING_SNAKE_CASE__			):
            # replace part of the key with corresponding layer name in HF implementation
            UpperCamelCase			:Optional[Any]      				=  k[len(SCREAMING_SNAKE_CASE__			) :]
            for old_layer_name in new_layer_name_dict:
                UpperCamelCase			:Any      				=  new_k.replace(SCREAMING_SNAKE_CASE__	,    new_layer_name_dict[old_layer_name]			)

            UpperCamelCase			:List[str]      				=  state_dict.pop(SCREAMING_SNAKE_CASE__			)

    UpperCamelCase			:List[str]      				=  set(state_dict.keys()			) - set(model.state_dict().keys()			)
    UpperCamelCase			:Any      				=  {k for k in extra_keys if not k.endswith('''.attn.bias'''			)}
    UpperCamelCase			:str      				=  set(model.state_dict().keys()			) - set(state_dict.keys()			)
    UpperCamelCase			:Any      				=  {k for k in missing_keys if not k.endswith('''.attn.bias'''			)}
    if len(SCREAMING_SNAKE_CASE__			) != 0:
        raise ValueError(F'''extra keys found: {extra_keys}'''			)
    if len(SCREAMING_SNAKE_CASE__			) != 0:
        raise ValueError(F'''missing keys: {missing_keys}'''			)
    model.load_state_dict(SCREAMING_SNAKE_CASE__	,    strict=SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:str      				=  model.num_parameters(exclude_embeddings=SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:str      				=  checkpoint["best_val_loss"].item()
    logger.info(F'''model loaded: {round(n_params/1e6	,    1			)}M params, {round(SCREAMING_SNAKE_CASE__	,    3			)} loss'''			)
    model.eval()
    model.to(SCREAMING_SNAKE_CASE__			)
    del checkpoint, state_dict

    return model


def     _A  (							SCREAMING_SNAKE_CASE__    :      Tuple	,    SCREAMING_SNAKE_CASE__    :      List[str]=False	,    SCREAMING_SNAKE_CASE__    :      Dict="text"			):
    if model_type not in ("text", "coarse", "fine"):
        raise NotImplementedError()

    UpperCamelCase			:Optional[int]      				=  "cpu"  # do conversion on cpu

    UpperCamelCase			:Tuple      				=  _get_ckpt_path(SCREAMING_SNAKE_CASE__	,    use_small=SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:str      				=  _load_model(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__	,    model_type=SCREAMING_SNAKE_CASE__	,    use_small=SCREAMING_SNAKE_CASE__			)

    # load bark initial model
    UpperCamelCase			:Dict      				=  _bark_load_model(SCREAMING_SNAKE_CASE__	,    '''cpu'''	,    model_type=SCREAMING_SNAKE_CASE__	,    use_small=SCREAMING_SNAKE_CASE__			)

    if model_type == "text":
        UpperCamelCase			:Dict      				=  bark_model["model"]

    if model.num_parameters(exclude_embeddings=SCREAMING_SNAKE_CASE__			) != bark_model.get_num_params():
        raise ValueError('''initial and new models don\'t have the same number of parameters'''			)

    # check if same output as the bark model
    UpperCamelCase			:Optional[Any]      				=  5
    UpperCamelCase			:Dict      				=  10

    if model_type in ["text", "coarse"]:
        UpperCamelCase			:Dict      				=  torch.randint(256	,    (batch_size, sequence_length)	,    dtype=torch.int			)
        UpperCamelCase			:Optional[Any]      				=  bark_model(SCREAMING_SNAKE_CASE__			)[0]

        UpperCamelCase			:Optional[Any]      				=  model(SCREAMING_SNAKE_CASE__			)

        # take last logits
        UpperCamelCase			:Optional[int]      				=  output_new_model_total.logits[:, [-1], :]

    else:
        UpperCamelCase			:Dict      				=  3
        UpperCamelCase			:Optional[int]      				=  8
        UpperCamelCase			:str      				=  torch.randint(256	,    (batch_size, sequence_length, n_codes_total)	,    dtype=torch.int			)

        UpperCamelCase			:str      				=  model(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__			)
        UpperCamelCase			:str      				=  bark_model(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__			)

        UpperCamelCase			:List[str]      				=  output_new_model_total.logits

    # output difference should come from the difference of self-attention implementation design
    if output_new_model.shape != output_old_model.shape:
        raise ValueError('''initial and new outputs don\'t have the same shape'''			)
    if (output_new_model - output_old_model).abs().max().item() > 1e-3:
        raise ValueError('''initial and new outputs are not equal'''			)

    Path(SCREAMING_SNAKE_CASE__			).mkdir(exist_ok=SCREAMING_SNAKE_CASE__			)
    model.save_pretrained(SCREAMING_SNAKE_CASE__			)


def     _A  (							SCREAMING_SNAKE_CASE__    :      Tuple	,    SCREAMING_SNAKE_CASE__    :      Tuple	,    SCREAMING_SNAKE_CASE__    :      Optional[int]	,    SCREAMING_SNAKE_CASE__    :      Dict	,    SCREAMING_SNAKE_CASE__    :      Any	,    SCREAMING_SNAKE_CASE__    :      Dict	,    ):
    UpperCamelCase			:Optional[int]      				=  os.path.join(SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__			)

    UpperCamelCase			:Optional[int]      				=  BarkSemanticConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE__	,    '''config.json'''			)			)
    UpperCamelCase			:int      				=  BarkCoarseConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE__	,    '''config.json'''			)			)
    UpperCamelCase			:List[Any]      				=  BarkFineConfig.from_pretrained(os.path.join(SCREAMING_SNAKE_CASE__	,    '''config.json'''			)			)
    UpperCamelCase			:List[Any]      				=  EncodecConfig.from_pretrained('''facebook/encodec_24khz'''			)

    UpperCamelCase			:Dict      				=  BarkSemanticModel.from_pretrained(SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:List[Any]      				=  BarkCoarseModel.from_pretrained(SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:Optional[Any]      				=  BarkFineModel.from_pretrained(SCREAMING_SNAKE_CASE__			)
    UpperCamelCase			:Optional[Any]      				=  EncodecModel.from_pretrained('''facebook/encodec_24khz'''			)

    UpperCamelCase			:Any      				=  BarkConfig.from_sub_model_configs(
        SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__	,    SCREAMING_SNAKE_CASE__			)

    UpperCamelCase			:Tuple      				=  BarkGenerationConfig.from_sub_model_configs(
        semantic.generation_config	,    coarseAcoustic.generation_config	,    fineAcoustic.generation_config			)

    UpperCamelCase			:Tuple      				=  BarkModel(SCREAMING_SNAKE_CASE__			)

    UpperCamelCase			:List[str]      				=  semantic
    UpperCamelCase			:int      				=  coarseAcoustic
    UpperCamelCase			:Union[str, Any]      				=  fineAcoustic
    UpperCamelCase			:str      				=  codec

    UpperCamelCase			:Optional[Any]      				=  bark_generation_config

    Path(SCREAMING_SNAKE_CASE__			).mkdir(exist_ok=SCREAMING_SNAKE_CASE__			)
    bark.save_pretrained(SCREAMING_SNAKE_CASE__	,    repo_id=SCREAMING_SNAKE_CASE__	,    push_to_hub=SCREAMING_SNAKE_CASE__			)


if __name__ == "__main__":
 __snake_case				   =    argparse.ArgumentParser()
 # Required parameters

 parser.add_argument("""model_type""", type=str, help="""text, coarse or fine.""")
 parser.add_argument("""pytorch_dump_folder_path""", default=None, type=str, help="""Path to the output PyTorch model.""")
 parser.add_argument("""--is_small""", action="""store_true""", help="""convert the small version instead of the large.""")

 __snake_case				   =    parser.parse_args()

 load_model(args.pytorch_dump_folder_path, model_type=args.model_type, use_small=args.is_small)












import warnings
from typing import Any, Dict, List, Optional, Union

import numpy as np

from ...audio_utils import mel_filter_bank, optimal_fft_length, spectrogram, window_function
from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
from ...feature_extraction_utils import BatchFeature
from ...utils import PaddingStrategy, TensorType, logging


SCREAMING_SNAKE_CASE__							:      Optional[int]         =    logging.get_logger(__name__)







class 	__lowerCAmelCase      (       _UpperCamelCase	):
   _UpperCamelCase			:    Tuple  		=					["""input_values""", """attention_mask"""]





   def __init__(			self       ,      snake_case = 1       ,      snake_case = 16_000       ,      snake_case = 0.0       ,      snake_case = False       ,      snake_case = 80       ,      snake_case = 16       ,      snake_case = 64       ,      snake_case = "hann_window"       ,      snake_case = 1.0       ,      snake_case = 80       ,      snake_case = 7_600       ,      snake_case = 1E-10       ,      snake_case = 2       ,      snake_case = True       ,      **snake_case       ,      )					->	Dict:
      """simple docstring"""





      super().__init__(feature_size=snake_case       ,      sampling_rate=snake_case       ,      padding_value=snake_case       ,      **snake_case   )
      a__						:    Any   		=	do_normalize
      a__						:    List[str]   		=	return_attention_mask

      a__						:    List[Any]   		=	num_mel_bins
      a__						:    List[str]   		=	hop_length
      a__						:    int   		=	win_length
      a__						:    List[Any]   		=	win_function
      a__						:    List[str]   		=	frame_signal_scale
      a__						:    List[Any]   		=	fmin
      a__						:    Optional[Any]   		=	fmax
      a__						:    Union[str, Any]   		=	mel_floor
      a__						:    Union[str, Any]   		=	reduction_factor

      a__						:    List[str]   		=	win_length * sampling_rate // 1_000
      a__						:    List[Any]   		=	hop_length * sampling_rate // 1_000
      a__						:    List[Any]   		=	optimal_fft_length(self.sample_size   )
      a__						:    Dict   		=	(self.n_fft // 2) + 1

      a__						:    str   		=	window_function(window_length=self.sample_size       ,      name=self.win_function       ,      periodic=snake_case   )

      a__						:    Tuple   		=	mel_filter_bank(
          num_frequency_bins=self.n_freqs       ,      num_mel_filters=self.num_mel_bins       ,      min_frequency=self.fmin       ,      max_frequency=self.fmax       ,      sampling_rate=self.sampling_rate       ,      norm="slaney"       ,      mel_scale="slaney"       ,      )

      if frame_signal_scale != 1.0:
         warnings.warn(
             "The argument `frame_signal_scale` is deprecated and will be removed in version 4.30.0 of Transformers"       ,      snake_case       ,      )
      if reduction_factor != 2.0:
         warnings.warn(
             "The argument `reduction_factor` is deprecated and will be removed in version 4.30.0 of Transformers"       ,      snake_case       ,      )





   @staticmethod
   # Copied from transformers.models.wav2vec2.feature_extraction_wav2vec2.Wav2Vec2FeatureExtractor.zero_mean_unit_var_norm
   def 						_snake_case			(			snake_case       ,      snake_case       ,      snake_case = 0.0   )					->	List[np.ndarray]:
      """simple docstring"""





      if attention_mask is not None:
         a__						:    Tuple   		=	np.array(snake_case       ,      np.intaa   )
         a__						:    List[str]   		=	[]

         for vector, length in zip(snake_case       ,      attention_mask.sum(-1   )   ):
            a__						:    List[Any]   		=	(vector - vector[:length].mean()) / np.sqrt(vector[:length].var() + 1E-7   )
            if length < normed_slice.shape[0]:
               a__						:    List[str]   		=	padding_value

            normed_input_values.append(snake_case   )
      else:
         a__						:    Any   		=	[(x - x.mean()) / np.sqrt(x.var() + 1E-7   ) for x in input_values]

      return normed_input_values





   def 						_snake_case			(			self       ,      snake_case       ,      )					->	np.ndarray:
      """simple docstring"""





      a__						:    str   		=	spectrogram(
          snake_case       ,      window=self.window       ,      frame_length=self.sample_size       ,      hop_length=self.sample_stride       ,      fft_length=self.n_fft       ,      mel_filters=self.mel_filters       ,      mel_floor=self.mel_floor       ,      log_mel="log10"       ,      )
      return log_mel_spec.T





   def __call__(			self       ,      snake_case = None       ,      snake_case = None       ,      snake_case = False       ,      snake_case = None       ,      snake_case = False       ,      snake_case = None       ,      snake_case = None       ,      snake_case = None       ,      snake_case = None       ,      **snake_case       ,      )					->	BatchFeature:
      """simple docstring"""





      if audio is None and audio_target is None:
         raise ValueError("You must provide either `audio` or `audio_target` values."   )

      if sampling_rate is not None:
         if sampling_rate != self.sampling_rate:
            raise ValueError(
                F"""The model corresponding to this feature extractor: {self} was trained using a sampling rate of"""
                F""" {self.sampling_rate}. Please make sure that the provided audio input was sampled with"""
                F""" {self.sampling_rate} and not {sampling_rate}."""   )
      else:
         logger.warning(
             "It is strongly recommended to pass the ``sampling_rate`` argument to this function. "
             "Failing to do so can result in silent errors that might be hard to debug."   )

      if audio is not None:
         a__						:    Dict   		=	self._process_audio(
             snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      **snake_case       ,      )
      else:
         a__						:    Optional[int]   		=	None

      if audio_target is not None:
         a__						:    List[Any]   		=	self._process_audio(
             snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      snake_case       ,      **snake_case       ,      )

         if inputs is None:
            return inputs_target
         else:
            a__						:    Tuple   		=	inputs_target["input_values"]
            a__						:    Tuple   		=	inputs_target.get("attention_mask"   )
            if decoder_attention_mask is not None:
               a__						:    Tuple   		=	decoder_attention_mask

      return inputs





   def 						_snake_case			(			self       ,      snake_case       ,      snake_case = False       ,      snake_case = False       ,      snake_case = None       ,      snake_case = False       ,      snake_case = None       ,      snake_case = None       ,      snake_case = None       ,      **snake_case       ,      )					->	BatchFeature:
      """simple docstring"""





      a__						:    Optional[int]   		=	isinstance(snake_case       ,      np.ndarray   ) and len(speech.shape   ) > 1
      if is_batched_numpy and len(speech.shape   ) > 2:
         raise ValueError(F"""Only mono-channel audio is supported for input to {self}"""   )
      a__						:    List[Any]   		=	is_batched_numpy or (
          isinstance(snake_case       ,      (list, tuple)   ) and (isinstance(speech[0]       ,      (np.ndarray, tuple, list)   ))
      )

      if is_batched:
         a__						:    int   		=	[np.asarray(snake_case       ,      dtype=np.floataa   ) for speech in speech]
      elif not is_batched and not isinstance(snake_case       ,      np.ndarray   ):
         a__						:    Any   		=	np.asarray(snake_case       ,      dtype=np.floataa   )
      elif isinstance(snake_case       ,      np.ndarray   ) and speech.dtype is np.dtype(np.floataa   ):
         a__						:    List[Any]   		=	speech.astype(np.floataa   )

      # always return batch
      if not is_batched:
         a__						:    Union[str, Any]   		=	[speech]

      # needed to make pad() work on spectrogram inputs
      a__						:    Optional[Any]   		=	self.feature_size

      # convert into correct format for padding
      if is_target:
         a__						:    List[str]   		=	[self._extract_mel_features(snake_case   ) for waveform in speech]
         a__						:    Optional[Any]   		=	BatchFeature({"input_values": features}   )
         a__						:    str   		=	self.num_mel_bins
      else:
         a__						:    int   		=	BatchFeature({"input_values": speech}   )

      a__						:    int   		=	self.pad(
          snake_case       ,      padding=snake_case       ,      max_length=snake_case       ,      truncation=snake_case       ,      pad_to_multiple_of=snake_case       ,      return_attention_mask=snake_case       ,      **snake_case       ,      )

      a__						:    Any   		=	feature_size_hack

      # convert input values to correct format
      a__						:    Tuple   		=	padded_inputs["input_values"]
      if not isinstance(input_values[0]       ,      np.ndarray   ):
         a__						:    int   		=	[np.asarray(snake_case       ,      dtype=np.floataa   ) for array in input_values]
      elif (
          not isinstance(snake_case       ,      np.ndarray   )
          and isinstance(input_values[0]       ,      np.ndarray   )
          and input_values[0].dtype is np.dtype(np.floataa   )
      ):
         a__						:    Union[str, Any]   		=	[array.astype(np.floataa   ) for array in input_values]
      elif isinstance(snake_case       ,      np.ndarray   ) and input_values.dtype is np.dtype(np.floataa   ):
         a__						:    Optional[int]   		=	input_values.astype(np.floataa   )

      # convert attention_mask to correct format
      a__						:    Optional[int]   		=	padded_inputs.get("attention_mask"   )
      if attention_mask is not None:
         a__						:    Tuple   		=	[np.asarray(snake_case       ,      dtype=np.intaa   ) for array in attention_mask]

      # zero-mean and unit-variance normalization
      if not is_target and self.do_normalize:
         a__						:    Any   		=	(
             attention_mask
             if self._get_padding_strategies(snake_case       ,      max_length=snake_case   ) is not PaddingStrategy.DO_NOT_PAD
             else None
         )
         a__						:    Optional[Any]   		=	self.zero_mean_unit_var_norm(
             padded_inputs["input_values"]       ,      attention_mask=snake_case       ,      padding_value=self.padding_value   )

      if return_tensors is not None:
         a__						:    int   		=	padded_inputs.convert_to_tensors(snake_case   )

      return padded_inputs





   def 						_snake_case			(			self   )					->	Dict[str, Any]:
      """simple docstring"""





      a__						:    int   		=	super().to_dict()

      # Don't serialize these as they are derived from the other properties.
      a__						:    str   		=	["window", "mel_filters", "sample_size", "sample_stride", "n_fft", "n_freqs"]
      for name in names:
         if name in output:
            del output[name]

      return output

