






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()
SCREAMING_SNAKE_CASE__				     =			logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__				     =			{
    '''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''',
}
SCREAMING_SNAKE_CASE__				     =			[
    '''lm_head''',
    '''quantizer.weight_proj''',
    '''quantizer.codevectors''',
    '''project_q''',
    '''project_hid''',
    '''projector''',
    '''classifier''',
]

def        UpperCAmelCase__		(						lowerCamelCase_       :       Tuple				):
			__a						:  str									=     {}
			with open(lowerCamelCase_   ,  'r'				) as file:
						for line_number, line in enumerate(lowerCamelCase_				):
									__a						:  Union[str, Any]									=     line.strip()
									if line:
												__a						:  List[Any]									=     line.split()
												__a						:  Union[str, Any]									=     line_number
												__a						:  Union[str, Any]									=     words[0]
												__a						:  Optional[int]									=     value
			return result

def        UpperCAmelCase__		(						lowerCamelCase_       :       Dict   ,  lowerCamelCase_       :       List[str]   ,  lowerCamelCase_       :       Tuple   ,  lowerCamelCase_       :       str   ,  lowerCamelCase_       :       Optional[int]				):
			for attribute in key.split('.'				):
						__a						:  Tuple									=     getattr(lowerCamelCase_   ,  lowerCamelCase_				)

			__a						:  Optional[int]									=     None
			for param_key in PARAM_MAPPING.keys():
						if full_name.endswith(lowerCamelCase_				):
									__a						:  str									=     PARAM_MAPPING[full_name.split('.'				)[-1]]
									__a						:  List[str]									=     'param'

			if weight_type is not None and weight_type != "param":
						__a						:  Optional[int]									=     getattr(lowerCamelCase_   ,  lowerCamelCase_				).shape
			elif weight_type is not None and weight_type == "param":
						__a						:  List[Any]									=     hf_pointer
						for attribute in hf_param_name.split('.'				):
									__a						:  Optional[Any]									=     getattr(lowerCamelCase_   ,  lowerCamelCase_				)
						__a						:  Tuple									=     shape_pointer.shape

						# let's reduce dimension
						__a						:  List[Any]									=     value[0]
			else:
						__a						:  Dict									=     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						:  Union[str, Any]									=     value
			elif weight_type == "weight_g":
						__a						:  Optional[Any]									=     value
			elif weight_type == "weight_v":
						__a						:  Any									=     value
			elif weight_type == "bias":
						__a						:  List[Any]									=     value
			elif weight_type == "param":
						for attribute in hf_param_name.split('.'				):
									__a						:  Any									=     getattr(lowerCamelCase_   ,  lowerCamelCase_				)
						__a						:  Union[str, Any]									=     value
			else:
						__a						:  Dict									=     value

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

def        UpperCAmelCase__		(						lowerCamelCase_       :       int   ,  lowerCamelCase_       :       int   ,  lowerCamelCase_       :       Dict   ,  lowerCamelCase_       :       Any   ,  lowerCamelCase_       :       Tuple				):
			__a						:  Optional[Any]									=     None
			for param_key in PARAM_MAPPING.keys():
						if full_name.endswith(lowerCamelCase_				):
									__a						:  Optional[int]									=     PARAM_MAPPING[full_name.split('.'				)[-1]]
									__a						:  Optional[int]									=     'param'

			if weight_type is not None and weight_type != "param":
						__a						:  Dict									=     '.'.join([key, weight_type]				)
			elif weight_type is not None and weight_type == "param":
						__a						:  List[str]									=     '.'.join([key, hf_param_name]				)
			else:
						__a						:  Optional[int]									=     key

			__a						:  Tuple									=     value if 'lm_head' in full_key else value[0]


SCREAMING_SNAKE_CASE__				     =			{
    '''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        UpperCAmelCase__		(						lowerCamelCase_       :       int   ,  lowerCamelCase_       :       List[str]   ,  lowerCamelCase_       :       Optional[int]=None   ,  lowerCamelCase_       :       str=None				):
			__a						:  str									=     False
			for key, mapped_key in MAPPING.items():
						__a						:  int									=     '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]:
									__a						:  str									=     True
									if "*" in mapped_key:
												__a						:  List[Any]									=     name.split(lowerCamelCase_				)[0].split('.'				)[-2]
												__a						:  List[Any]									=     mapped_key.replace('*'   ,  lowerCamelCase_				)
									if "weight_g" in name:
												__a						:  Union[str, Any]									=     'weight_g'
									elif "weight_v" in name:
												__a						:  str									=     'weight_v'
									elif "bias" in name:
												__a						:  Any									=     'bias'
									elif "weight" in name:
												# TODO: don't match quantizer.weight_proj
												__a						:  Optional[int]									=     'weight'
									else:
												__a						:  Tuple									=     None
									if hf_dict is not None:
												rename_dict(lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_				)
									else:
												set_recursively(lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_				)
									return is_used
			return is_used

def        UpperCAmelCase__		(						lowerCamelCase_       :       Dict   ,  lowerCamelCase_       :       Any   ,  lowerCamelCase_       :       str				):
			__a						:  Tuple									=     []
			__a						:  Dict									=     fairseq_model.state_dict()

			__a						:  List[str]									=     hf_model.wavaveca.feature_extractor

			for name, value in fairseq_dict.items():
						__a						:  Optional[int]									=     False
						if "conv_layers" in name:
									load_conv_layer(
									    lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_   ,  hf_model.config.feat_extract_norm == 'group'   ,  )
									__a						:  int									=     True
						else:
									__a						:  Tuple									=     load_wavaveca_layer(lowerCamelCase_   ,  lowerCamelCase_   ,  lowerCamelCase_				)
						if not is_used:
									unused_weights.append(lowerCamelCase_				)

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

def        UpperCAmelCase__		(						lowerCamelCase_       :       int   ,  lowerCamelCase_       :       Any   ,  lowerCamelCase_       :       Tuple   ,  lowerCamelCase_       :       Optional[int]   ,  lowerCamelCase_       :       Optional[Any]				):
			__a						:  List[Any]									=     full_name.split('conv_layers.'				)[-1]
			__a						:  List[str]									=     name.split('.'				)
			__a						:  int									=     int(items[0]				)
			__a						:  str									=     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						:  str									=     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						:  Optional[int]									=     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.'''				)
									__a						:  Union[str, Any]									=     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.'''				)
									__a						:  Any									=     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        UpperCAmelCase__		(						lowerCamelCase_       :       List[Any]   ,  lowerCamelCase_       :       Any   ,  lowerCamelCase_       :       int=None   ,  lowerCamelCase_       :       Optional[Any]=None   ,  lowerCamelCase_       :       Union[str, Any]=True   ,  lowerCamelCase_       :       Any=False				):
			if config_path is not None:
						__a						:  Union[str, Any]									=     WavaVecaConfig.from_pretrained(lowerCamelCase_				)
			else:
						__a						:  Tuple									=     WavaVecaConfig()

			if is_seq_class:
						__a						:  int									=     read_txt_into_dict(lowerCamelCase_				)
						__a						:  Any									=     idalabel
						__a						:  Optional[Any]									=     WavaVecaForSequenceClassification(lowerCamelCase_				)
						__a						:  Union[str, Any]									=     WavaVecaFeatureExtractor(
						    feature_size=1   ,  sampling_rate=1_6_0_0_0   ,  padding_value=0   ,  do_normalize=lowerCamelCase_   ,  return_attention_mask=lowerCamelCase_   ,  )
						feature_extractor.save_pretrained(lowerCamelCase_				)

			elif is_finetuned:
						if dict_path:
									__a						:  List[str]									=     Dictionary.load(lowerCamelCase_				)

									# important change bos & pad token id since CTC symbol is <pad> and
									# not <s> as in fairseq
									__a						:  List[str]									=     target_dict.pad_index
									__a						:  Any									=     target_dict.bos_index
									__a						:  Dict									=     target_dict.eos_index
									__a						:  List[str]									=     len(target_dict.symbols				)
									__a						:  Optional[Any]									=     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_				)
									__a						:  Optional[Any]									=     target_dict.indices

									# fairseq has the <pad> and <s> switched
									__a						:  Optional[Any]									=     0
									__a						:  Union[str, Any]									=     1
									with open(lowerCamelCase_   ,  'w'   ,  encoding='utf-8'				) as vocab_handle:
												json.dump(lowerCamelCase_   ,  lowerCamelCase_				)
									__a						:  str									=     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_   ,  )
									__a						:  Any									=     True if config.feat_extract_norm == 'layer' else False
									__a						:  Optional[int]									=     WavaVecaFeatureExtractor(
									    feature_size=1   ,  sampling_rate=1_6_0_0_0   ,  padding_value=0   ,  do_normalize=lowerCamelCase_   ,  return_attention_mask=lowerCamelCase_   ,  )
									__a						:  Tuple									=     WavaVecaProcessor(feature_extractor=lowerCamelCase_   ,  tokenizer=lowerCamelCase_				)
									processor.save_pretrained(lowerCamelCase_				)

						__a						:  List[Any]									=     WavaVecaForCTC(lowerCamelCase_				)
			else:
						__a						:  List[str]									=     WavaVecaForPreTraining(lowerCamelCase_				)

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

						__a						,					__a						,					__a						:  Optional[int]									=     fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_path]   ,  task=lowerCamelCase_				)

			__a						:  str									=     model[0].eval()

			recursively_load_weights(lowerCamelCase_   ,  lowerCamelCase_   ,  not is_finetuned				)

			hf_wavavec.save_pretrained(lowerCamelCase_				)


if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__				     =			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''',
							)
							SCREAMING_SNAKE_CASE__				     =			parser.parse_args()

							SCREAMING_SNAKE_CASE__				     =			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,
							)







"""simple docstring"""




import argparse
import re

from flax.traverse_util import flatten_dict, unflatten_dict
from tax import checkpoints

from transformers import SwitchTransformersConfig, SwitchTransformersForConditionalGeneration
from transformers.modeling_flax_pytorch_utils import load_flax_weights_in_pytorch_model
from transformers.utils import logging


logging.set_verbosity_info()


# should not include what is already done by the `from_pt` argument
a		:       int     						=       {
    '/attention/': '/0/SelfAttention/',
    '/self_attention/': '/0/SelfAttention/',
    '/encoder_decoder_attention/': '/1/EncDecAttention/',
    'value': 'v',
    'query': 'q',
    'key': 'k',
    'out': 'o',
    'pre_self_attention_layer_norm': '0/layer_norm',
    'pre_cross_attention_layer_norm': '1/layer_norm',
    'pre_attention_layer_norm': '0/layer_norm',  # previously 1, but seems wrong
    'token_embedder': 'shared',
    'encoder_norm': 'final_layer_norm',
    'decoder_norm': 'final_layer_norm',
    'relpos_bias/rel_embedding': 'block/0/layer/0/SelfAttention/relative_attention_bias/weight',
    'router/router_weights/w/': 'router/classifier/',
    'roer/roer_weights/w/': 'router/classifier/',
    'logits_dense': 'lm_head',
}



def     __magic_name__		(					UpperCamelCase     :		List[Any]     )     ->						Union[str, Any]:
    # 1. in HF T5, we have block.{x}.layer.{y}. which corresponds to layer.{x} in
    # the original model
    a__		=			list(s_dict.keys()     )
    for key in keys:
        a__		=			r'.*/layers_(\d+)'
        a__		=			key
        if re.match(UpperCamelCase							,		UpperCamelCase     ):
            a__		=			re.sub(r'layers_(\d+)'							,		r'block/\1/layer'							,		UpperCamelCase     )

        a__		=			r'(encoder|decoder)\/'

        if re.match(UpperCamelCase							,		UpperCamelCase     ):
            a__		=			re.match(UpperCamelCase							,		UpperCamelCase     ).groups()
            if groups[0] == "encoder":
                a__		=			re.sub(r'/mlp/'							,		r'/1/mlp/'							,		UpperCamelCase     )
                a__		=			re.sub(r'/pre_mlp_layer_norm/'							,		r'/1/layer_norm/'							,		UpperCamelCase     )

            elif groups[0] == "decoder":
                a__		=			re.sub(r'/mlp/'							,		r'/2/mlp/'							,		UpperCamelCase     )
                a__		=			re.sub(r'/pre_mlp_layer_norm/'							,		r'/2/layer_norm/'							,		UpperCamelCase     )

        # 2. Convert other classic mappings
        for old_key, temp_key in MOE_LAYER_NAME_MAPPING.items():
            if old_key in new_key:
                a__		=			new_key.replace(UpperCamelCase							,		UpperCamelCase     )

        print(f'{key} -> {new_key}'     )
        a__		=			s_dict.pop(UpperCamelCase     )

    if "encoder/block/0/layer/0/SelfAttention/relative_attention_bias/weight" in s_dict:
        a__		=			s_dict[
            'encoder/block/0/layer/0/SelfAttention/relative_attention_bias/weight'
        ].T
    if "decoder/block/0/layer/0/SelfAttention/relative_attention_bias/weight" in s_dict:
        a__		=			s_dict[
            'decoder/block/0/layer/0/SelfAttention/relative_attention_bias/weight'
        ].T

    # 3. Take extra care of the EXPERTS layer
    for key in list(s_dict.keys()     ):
        if "expert" in key:
            a__		=			s_dict[key].shape[0]
            a__		=			s_dict[key]
            for idx in range(UpperCamelCase     ):
                a__		=			expert_weihts[idx]
                print(f'{key} -> {key.replace("expert/"							,		"nested fstring"     )}'     )

            s_dict.pop(UpperCamelCase     )

    return s_dict


a		:       List[str]     						=       {
    'NUM_ENCODER_LAYERS': 'num_layers',
    'NUM_DECODER_LAYERS': 'num_decoder_layers',
    'NUM_HEADS': 'num_heads',
    'HEAD_DIM': 'd_kv',
    'EMBED_DIM': 'd_model',
    'MLP_DIM': 'd_ff',
    'NUM_SELECTED_EXPERTS': 'num_selected_experts',
    'NUM_ENCODER_SPARSE_LAYERS': 'num_sparse_encoder_layers',
    'NUM_DECODER_SPARSE_LAYERS': 'num_sparse_decoder_layers',
    'dense.MlpBlock.activations': 'feed_forward_proj',
}



def     __magic_name__		(					UpperCamelCase     :		Optional[int]							,		UpperCamelCase     :		Optional[int]     )     ->						Optional[int]:
    # Convert a google style config to the hugging face fromat
    import regex as re

    with open(UpperCamelCase							,		'r'     ) as f:
        a__		=			f.read()

    a__		=			re.findall(r'(.*) = ([0-9.]*)'							,		UpperCamelCase     )
    a__		=			{}
    for param, value in regex_match:
        if param in GIN_TO_CONFIG_MAPPING and value != "":
            a__		=			float(UpperCamelCase     ) if '.' in value else int(UpperCamelCase     )

    a__		=			re.findall(r'(.*activations) = \(\'(.*)\',\)'							,		UpperCamelCase     )[0]
    a__		=			str(activation[1]     )

    a__		=			num_experts
    a__		=			SwitchTransformersConfig(**UpperCamelCase     )
    return config



def     __magic_name__		(					UpperCamelCase     :		str							,		UpperCamelCase     :		Tuple							,		UpperCamelCase     :		Union[str, Any]=None							,		UpperCamelCase     :		List[str]="./"							,		UpperCamelCase     :		Any=8     )     ->						Union[str, Any]:
    # Initialise PyTorch model

    print(f'Loading flax weights from : {flax_checkpoint_path}'     )
    a__		=			checkpoints.load_tax_checkpoint(UpperCamelCase     )

    if gin_file is not None:
        a__		=			convert_gin_to_config(UpperCamelCase							,		UpperCamelCase     )
    else:
        a__		=			SwitchTransformersConfig.from_pretrained(UpperCamelCase     )

    a__		=			SwitchTransformersForConditionalGeneration(UpperCamelCase     )

    a__		=			flax_params['target']
    a__		=			flatten_dict(UpperCamelCase							,		sep='/'     )
    a__		=			rename_keys(UpperCamelCase     )
    a__		=			unflatten_dict(UpperCamelCase							,		sep='/'     )

    # Load the flax params in the PT model
    load_flax_weights_in_pytorch_model(UpperCamelCase							,		UpperCamelCase     )

    print(f'Save PyTorch model to {pytorch_dump_path}'     )
    pt_model.save_pretrained(UpperCamelCase     )


if __name__ == "__main__":
    a		:       Dict     						=       argparse.ArgumentParser()
    # Required parameters
    parser.add_argument(
        '--switch_t5x_checkpoint_path',
        default=None,
        type=str,
        required=True,
        help=(
            'The config json file corresponding to the pre-trained SwitchTransformers model. \nThis specifies the'
            ' model architecture. If not provided, a `gin_file` has to be provided.'
        ),
    )
    parser.add_argument(
        '--gin_file',
        default=None,
        type=str,
        required=False,
        help='Path to the gin config file. If not provided, a `config_file` has to be passed   ',
    )
    parser.add_argument(
        '--config_name', default=None, type=str, required=False, help='Config name of SwitchTransformers model.'
    )
    parser.add_argument(
        '--pytorch_dump_folder_path', default=None, type=str, required=True, help='Path to the output pytorch model.'
    )
    parser.add_argument('--num_experts', default=8, type=int, required=False, help='Number of experts')
    a		:       List[str]     						=       parser.parse_args()
    convert_flax_checkpoint_to_pytorch(
        args.switch_tax_checkpoint_path,
        args.config_name,
        args.gin_file,
        args.pytorch_dump_folder_path,
        args.num_experts,
    )


