





import inspect

import jax
import jax.lax as lax
import jax.numpy as jnp

from ..utils import add_start_docstrings
from ..utils.logging import get_logger


snake_case__					:							Union[str, Any]													=     get_logger(__name__)


snake_case__					:							List[str]													=     r'\n    Args:\n        input_ids (`jnp.ndarray` of shape `(batch_size, sequence_length)`):\n            Indices of input sequence tokens in the vocabulary.\n\n            Indices can be obtained using [`PreTrainedTokenizer`]. See [`PreTrainedTokenizer.encode`] and\n            [`PreTrainedTokenizer.__call__`] for details.\n\n            [What are input IDs?](../glossary#input-ids)\n        scores (`jnp.ndarray` of shape `(batch_size, config.vocab_size)`):\n            Prediction scores of a language modeling head. These can be logits for each vocabulary when not using beam\n            search or log softmax for each vocabulary token when using beam search\n        kwargs (`Dict[str, Any]`, *optional*):\n            Additional logits processor specific kwargs.\n\n    Return:\n        `jnp.ndarray` of shape `(batch_size, config.vocab_size)`: The processed prediction scores.\n\n'





class A_					:




   @add_start_docstrings(_UpperCamelCase )
   def __call__(self	:Dict    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray )->					jnp.ndarray:
         raise NotImplementedError(
             f"""{self.__class__} is an abstract class. Only classes inheriting this class can be called.""" )





class A_					:




   @add_start_docstrings(_UpperCamelCase )
   def __call__(self	:Tuple    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray )->					jnp.ndarray:
         raise NotImplementedError(
             f"""{self.__class__} is an abstract class. Only classes inheriting this class can be called.""" )





class A_					(			_lowerCamelCase   ):




   @add_start_docstrings(_UpperCamelCase )
   def __call__(self	:List[str]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int    ,   **_UpperCamelCase	:Any )->					jnp.ndarray:
         for processor in self:
               __A          =				inspect.signature(processor.__call__ ).parameters
               if len(_UpperCamelCase ) > 3:
                     if not all(arg in kwargs for arg in list(function_args.keys() )[2:] ):
                           raise ValueError(
                               f"""Make sure that all the required parameters: {list(function_args.keys() )} for """
                               f"""{processor.__class__} are passed to the logits processor.""" )
                     __A          =				processor(_UpperCamelCase    ,   _UpperCamelCase    ,   _UpperCamelCase    ,   **_UpperCamelCase )
               else:
                     __A          =				processor(_UpperCamelCase    ,   _UpperCamelCase    ,   _UpperCamelCase )
         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:List[str]    ,   _UpperCamelCase	:float )->					int:
         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or not (temperature > 0):
               raise ValueError(f"""`temperature` has to be a strictly positive float, but is {temperature}""" )

         __A          =				temperature






   def __call__(self	:Optional[int]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A          =				scores / self.temperature
         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:List[str]    ,   _UpperCamelCase	:float    ,   _UpperCamelCase	:float = -float('''Inf''' )    ,   _UpperCamelCase	:int = 1 )->					int:
         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or (top_p < 0 or top_p > 1.0):
               raise ValueError(f"""`top_p` has to be a float > 0 and < 1, but is {top_p}""" )
         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or (min_tokens_to_keep < 1):
               raise ValueError(f"""`min_tokens_to_keep` has to be a positive integer, but is {min_tokens_to_keep}""" )

         __A          =				top_p
         __A          =				filter_value
         __A          =				min_tokens_to_keep






   def __call__(self	:Union[str, Any]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A   ,						__A          =				lax.top_k(_UpperCamelCase    ,   scores.shape[-1] )

         __A          =				jnp.full_like(_UpperCamelCase    ,   self.filter_value )
         __A          =				jax.nn.softmax(_UpperCamelCase    ,   axis=-1 ).cumsum(axis=-1 )
         __A          =				cumulative_probs < self.top_p

         # include the token that is higher than top_p as well
         __A          =				jnp.roll(_UpperCamelCase    ,   1 )
         score_mask |= score_mask.at[:, 0].set(_UpperCamelCase )

         # min tokens to keep
         __A          =				score_mask.at[:, : self.min_tokens_to_keep].set(_UpperCamelCase )

         __A          =				jnp.where(_UpperCamelCase    ,   _UpperCamelCase    ,   _UpperCamelCase )
         __A          =				jax.lax.sort_key_val(_UpperCamelCase    ,   _UpperCamelCase )[-1]

         return next_scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:List[str]    ,   _UpperCamelCase	:int    ,   _UpperCamelCase	:float = -float('''Inf''' )    ,   _UpperCamelCase	:int = 1 )->					List[str]:
         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or top_k <= 0:
               raise ValueError(f"""`top_k` has to be a strictly positive integer, but is {top_k}""" )

         __A          =				max(_UpperCamelCase    ,   _UpperCamelCase )
         __A          =				filter_value






   def __call__(self	:int    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A   ,						__A          =				scores.shape
         __A          =				jnp.full(batch_size * vocab_size    ,   self.filter_value )

         __A          =				min(self.top_k    ,   scores.shape[-1] )  # Safety check
         __A   ,						__A          =				lax.top_k(_UpperCamelCase    ,   _UpperCamelCase )
         __A          =				jnp.broadcast_to((jnp.arange(_UpperCamelCase ) * vocab_size)[:, None]    ,   (batch_size, topk) ).flatten()
         __A          =				topk_scores.flatten()
         __A          =				topk_indices.flatten() + shift

         __A          =				next_scores_flat.at[topk_indices_flat].set(_UpperCamelCase )
         __A          =				next_scores_flat.reshape(_UpperCamelCase    ,   _UpperCamelCase )
         return next_scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:Optional[int]    ,   _UpperCamelCase	:int )->					Dict:
         __A          =				bos_token_id






   def __call__(self	:Union[str, Any]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A          =				jnp.full(scores.shape    ,   -float('''inf''' ) )

         __A          =				1 - jnp.bool_(cur_len - 1 )

         __A          =				jnp.where(_UpperCamelCase    ,   new_scores.at[:, self.bos_token_id].set(0 )    ,   _UpperCamelCase )

         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:List[Any]    ,   _UpperCamelCase	:int    ,   _UpperCamelCase	:int )->					Optional[Any]:
         __A          =				max_length
         __A          =				eos_token_id






   def __call__(self	:int    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A          =				jnp.full(scores.shape    ,   -float('''inf''' ) )

         __A          =				1 - jnp.bool_(cur_len - self.max_length + 1 )

         __A          =				jnp.where(_UpperCamelCase    ,   new_scores.at[:, self.eos_token_id].set(0 )    ,   _UpperCamelCase )

         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:int    ,   _UpperCamelCase	:int    ,   _UpperCamelCase	:int )->					Any:
         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or min_length < 0:
               raise ValueError(f"""`min_length` has to be a positive integer, but is {min_length}""" )

         if not isinstance(_UpperCamelCase    ,   _UpperCamelCase ) or eos_token_id < 0:
               raise ValueError(f"""`eos_token_id` has to be a positive integer, but is {eos_token_id}""" )

         __A          =				min_length
         __A          =				eos_token_id






   def __call__(self	:str    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         # create boolean flag to decide if min length penalty should be applied
         __A          =				1 - jnp.clip(cur_len - self.min_length    ,   0    ,   1 )

         __A          =				jnp.where(_UpperCamelCase    ,   scores.at[:, self.eos_token_id].set(-float('''inf''' ) )    ,   _UpperCamelCase )

         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:List[Any]    ,   _UpperCamelCase	:Optional[Any]    ,   _UpperCamelCase	:Optional[Any] )->					Tuple:
         __A          =				list(_UpperCamelCase )
         __A          =				begin_index






   def __call__(self	:int    ,   _UpperCamelCase	:str    ,   _UpperCamelCase	:Any    ,   _UpperCamelCase	:int )->					Optional[int]:
         __A          =				1 - jnp.bool_(cur_len - self.begin_index )

         __A          =				jnp.where(_UpperCamelCase    ,   scores.at[:, self.begin_suppress_tokens].set(-float('''inf''' ) )    ,   _UpperCamelCase )

         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:int    ,   _UpperCamelCase	:list )->					Dict:
         __A          =				list(_UpperCamelCase )






   def __call__(self	:Optional[Any]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         __A          =				scores.at[..., self.suppress_tokens].set(-float('''inf''' ) )

         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:Optional[int]    ,   _UpperCamelCase	:List[str] )->					Optional[int]:
         __A          =				dict(_UpperCamelCase )
         # Converts the dictionary of format {index: token} containing the tokens to be forced to an array, where the
         # index of the array corresponds to the index of the token to be forced, for XLA compatibility.
         # Indexes without forced tokens will have a negative value.
         __A          =				jnp.ones((max(force_token_map.keys() ) + 1)    ,   dtype=jnp.intaa ) * -1
         for index, token in force_token_map.items():
               if token is not None:
                     __A          =				force_token_array.at[index].set(_UpperCamelCase )
         __A          =				jnp.intaa(_UpperCamelCase )






   def __call__(self	:Optional[Any]    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:jnp.ndarray    ,   _UpperCamelCase	:int )->					jnp.ndarray:
         def _force_token(_UpperCamelCase	:Tuple ):
               __A          =				scores.shape[0]
               __A          =				self.force_token_array[generation_idx]

               __A          =				jnp.ones_like(_UpperCamelCase    ,   dtype=scores.dtype ) * -float('''inf''' )
               __A          =				jnp.zeros((batch_size, 1)    ,   dtype=scores.dtype )
               __A          =				lax.dynamic_update_slice(_UpperCamelCase    ,   _UpperCamelCase    ,   (0, current_token) )
               return new_scores

         __A          =				lax.cond(
             cur_len >= self.force_token_array.shape[0]    ,   lambda: scores    ,   lambda: lax.cond(
                 self.force_token_array[cur_len] >= 0    ,   lambda: _force_token(_UpperCamelCase )    ,   lambda: scores    ,   )    ,   )
         return scores





class A_					(			_lowerCamelCase   ):




   def __init__(self	:Tuple    ,   _UpperCamelCase	:List[str]    ,   _UpperCamelCase	:Dict    ,   _UpperCamelCase	:Any )->					Optional[Any]:
         __A          =				generate_config.eos_token_id
         __A          =				generate_config.no_timestamps_token_id
         __A          =				generate_config.no_timestamps_token_id + 1

         __A          =				decoder_input_length + 1

         if generate_config.is_multilingual:
               # room for language token and task token
               self.begin_index += 2
         if hasattr(_UpperCamelCase    ,   '''max_initial_timestamp_index''' ):
               __A          =				generate_config.max_initial_timestamp_index
         else:
               __A          =				model_config.vocab_size
         if self.max_initial_timestamp_index is None:
               __A          =				model_config.vocab_size






   def __call__(self	:Optional[Any]    ,   _UpperCamelCase	:Any    ,   _UpperCamelCase	:Any    ,   _UpperCamelCase	:Union[str, Any] )->					Any:
         # suppress <|notimestamps|> which is handled by without_timestamps
         __A          =				scores.at[:, self.no_timestamps_token_id].set(-float('''inf''' ) )

         def handle_pairs(_UpperCamelCase	:Union[str, Any]    ,   _UpperCamelCase	:Optional[Any] ):
               __A          =				jnp.where((cur_len - self.begin_index) >= 1    ,   _UpperCamelCase    ,   _UpperCamelCase )
               __A          =				jnp.where(
                   input_ids_k[cur_len - 1] >= self.timestamp_begin    ,   True and last_was_timestamp    ,   _UpperCamelCase    ,   )

               __A          =				jnp.where((cur_len - self.begin_index) < 2    ,   _UpperCamelCase    ,   _UpperCamelCase )
               __A          =				jnp.where(
                   input_ids_k[cur_len - 2] >= self.timestamp_begin    ,   _UpperCamelCase    ,   _UpperCamelCase    ,   )

               return jnp.where(
                   _UpperCamelCase    ,   jnp.where(
                       penultimate_was_timestamp > 0    ,   scores_k.at[self.timestamp_begin :].set(-float('''inf''' ) )    ,   scores_k.at[: self.eos_token_id].set(-float('''inf''' ) )    ,   )    ,   _UpperCamelCase    ,   )

         __A          =				jax.vmap(_UpperCamelCase )(_UpperCamelCase    ,   _UpperCamelCase )

         __A          =				jnp.where(cur_len == self.begin_index    ,   _UpperCamelCase    ,   _UpperCamelCase )
         __A          =				jnp.where(
             self.max_initial_timestamp_index is not None    ,   True and apply_max_initial_timestamp    ,   _UpperCamelCase    ,   )

         __A          =				self.timestamp_begin + self.max_initial_timestamp_index

         __A          =				jnp.where(
             _UpperCamelCase    ,   scores.at[:, last_allowed + 1 :].set(-float('''inf''' ) )    ,   _UpperCamelCase    ,   )

         # if sum of probability over timestamps is above any other token, sample timestamp
         __A          =				jax.nn.log_softmax(_UpperCamelCase    ,   axis=-1 )

         def handle_cumulative_probs(_UpperCamelCase	:Optional[Any]    ,   _UpperCamelCase	:List[Any] ):
               __A          =				jax.nn.logsumexp(logprobs_k[self.timestamp_begin :]    ,   axis=-1 )
               __A          =				jnp.max(logprobs_k[: self.timestamp_begin] )
               return jnp.where(
                   timestamp_logprob > max_text_token_logprob    ,   scores_k.at[: self.timestamp_begin].set(-float('''inf''' ) )    ,   _UpperCamelCase    ,   )

         __A          =				jax.vmap(_UpperCamelCase )(_UpperCamelCase    ,   _UpperCamelCase )

         return scores












import argparse

import fairseq
import torch

from transformers import UniSpeechSatConfig, UniSpeechSatForCTC, UniSpeechSatForPreTraining, logging


logging.set_verbosity_info()
snake_case__					:							Dict													=     logging.get_logger(__name__)

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



def _a				(	lowerCamelCase:   List[Any]					,				lowerCamelCase:   Any					,				lowerCamelCase:   Union[str, Any]					,				lowerCamelCase:   Any					,				lowerCamelCase:   int )	->						List[str]:







      '''simple docstring'''






      for attribute in key.split('''.''' ):
            __A          =				getattr(lowerCamelCase					,				lowerCamelCase )

      if weight_type is not None:
            __A          =				getattr(lowerCamelCase					,				lowerCamelCase ).shape
      else:
            __A          =				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":
            __A          =				value
      elif weight_type == "weight_g":
            __A          =				value
      elif weight_type == "weight_v":
            __A          =				value
      elif weight_type == "bias":
            __A          =				value
      else:
            __A          =				value

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



def _a				(	lowerCamelCase:   List[str]					,				lowerCamelCase:   Optional[int] )	->						Tuple:







      '''simple docstring'''






      __A          =				[]
      __A          =				fairseq_model.state_dict()

      __A          =				hf_model.unispeech_sat.feature_extractor

      for name, value in fairseq_dict.items():
            __A          =				False
            if "conv_layers" in name:
                  load_conv_layer(
                      lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase					,				lowerCamelCase					,				hf_model.config.feat_extract_norm == '''group'''					,				)
                  __A          =				True
            else:
                  for key, mapped_key in MAPPING.items():
                        __A          =				'''unispeech_sat.''' + mapped_key if mapped_key not in TOP_LEVEL_KEYS else mapped_key
                        if key in name or key.split('''w2v_model.''' )[-1] == name.split('''.''' )[0]:
                              if "layer_norm_for_extract" in name and (".".join(name.split('''.''' )[:-1] ) != key):
                                    # special case since naming is very similar
                                    continue
                              __A          =				True
                              if "*" in mapped_key:
                                    __A          =				name.split(lowerCamelCase )[0].split('''.''' )[-2]
                                    __A          =				mapped_key.replace('''*'''					,				lowerCamelCase )
                              if "weight_g" in name:
                                    __A          =				'''weight_g'''
                              elif "weight_v" in name:
                                    __A          =				'''weight_v'''
                              elif "bias" in name:
                                    __A          =				'''bias'''
                              elif "weight" in name:
                                    # TODO: don't match quantizer.weight_proj
                                    __A          =				'''weight'''
                              else:
                                    __A          =				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:   int					,				lowerCamelCase:   Any					,				lowerCamelCase:   int					,				lowerCamelCase:   int					,				lowerCamelCase:   List[str] )	->						Union[str, Any]:







      '''simple docstring'''






      __A          =				full_name.split('''conv_layers.''' )[-1]
      __A          =				name.split('''.''' )
      __A          =				int(items[0] )
      __A          =				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.""" )
                  __A          =				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.""" )
                  __A          =				value
                  logger.info(F"""Feat extract conv layer {layer_id} was initialized from {full_name}.""" )
      elif (type_id == 2 and not use_group_norm) or (type_id == 2 and layer_id == 0 and use_group_norm):
            if "bias" in name:
                  if value.shape != feature_extractor.conv_layers[layer_id].layer_norm.bias.data.shape:
                        raise ValueError(
                            F"""{full_name} has size {value.shape}, but"""
                            F""" {feature_extractor[layer_id].layer_norm.bias.data.shape} was found.""" )
                  __A          =				value
                  logger.info(F"""Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.""" )
            elif "weight" in name:
                  if value.shape != feature_extractor.conv_layers[layer_id].layer_norm.weight.data.shape:
                        raise ValueError(
                            F"""{full_name} has size {value.shape}, but"""
                            F""" {feature_extractor[layer_id].layer_norm.weight.data.shape} was found.""" )
                  __A          =				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:   Tuple					,				lowerCamelCase:   int					,				lowerCamelCase:   Optional[Any]=None					,				lowerCamelCase:   Optional[Any]=None					,				lowerCamelCase:   Optional[int]=True )	->						List[Any]:







      '''simple docstring'''






      if config_path is not None:
            __A          =				UniSpeechSatConfig.from_pretrained(lowerCamelCase )
      else:
            __A          =				UniSpeechSatConfig()

      __A          =				''''''

      if is_finetuned:
            __A          =				UniSpeechSatForCTC(lowerCamelCase )
      else:
            __A          =				UniSpeechSatForPreTraining(lowerCamelCase )

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

      recursively_load_weights(lowerCamelCase					,				lowerCamelCase )

      hf_wavavec.save_pretrained(lowerCamelCase )


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





