

import argparse

import fairseq
import torch
from torch import nn

from transformers import (
    MBartaaTokenizer,
    MBartConfig,
    MBartForCausalLM,
    SpeechEncoderDecoderConfig,
    SpeechEncoderDecoderModel,
    WavaVecaConfig,
    WavaVecaFeatureExtractor,
    WavaVecaModel,
    logging,
)


logging.set_verbosity_info()
__snake_case				:      int   		=			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""",
    """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""",
}
__snake_case				:      List[str]   		=			[
    """lm_head""",
    """quantizer.weight_proj""",
    """quantizer.codevectors""",
    """project_q""",
    """project_hid""",
]


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			for attribute in key.split("""."""):
						a_						:						List[Any] 							= getattr(a__  ,	a__)

			if weight_type is not None:
						a_						:						List[Any] 							= getattr(a__  ,	a__).shape
			else:
						a_						:						Optional[Any] 							= hf_pointer.shape

			assert hf_shape == value.shape, (
			    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_						:						List[Any] 							= value
			elif weight_type == "weight_v":
						a_						:						int 							= value
			elif weight_type == "bias":
						a_						:						Dict 							= value
			else:
						a_						:						str 							= value

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


def 					_UpperCAmelCase				(						a__  ,	a__):

			'''simple docstring'''



			a_						:						str 							= []
			a_						:						int 							= fairseq_model.state_dict()

			a_						:						int 							= hf_model.feature_extractor
			a_						:						Optional[int] 							= hf_model.adapter

			for name, value in fairseq_dict.items():
						a_						:						Dict 							= False
						if "conv_layers" in name:
									load_conv_layer(
									    a__  ,	a__  ,	a__  ,	a__  ,	hf_model.config.feat_extract_norm == """group"""  ,	)
									a_						:						str 							= True
						elif any(x in name for x in ["""adaptor""", """w2v_encoder.proj.""", """w2v_proj_ln."""]):
									load_adapter(a__  ,	a__  ,	a__  ,	a__)
									a_						:						Dict 							= True
						else:
									for key, mapped_key in MAPPING.items():
												if key in name or key.split("""w2v_model.""")[-1] == name.split(""".""")[0]:
															a_						:						int 							= True
															if "*" in mapped_key:
																		a_						:						Dict 							= name.split(a__)[0].split(""".""")[-2]
																		a_						:						str 							= mapped_key.replace("""*"""  ,	a__)
															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_						:						Optional[int] 							= """bias"""
															elif "weight" in name:
																		a_						:						Any 							= """weight"""
															else:
																		a_						:						int 							= None
															set_recursively(a__  ,	a__  ,	a__  ,	a__  ,	a__)
												continue
						if not is_used:
									unused_weights.append(a__)

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


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			a_						:						int 							= full_name.split("""conv_layers.""")[-1]
			a_						:						str 							= name.split(""".""")
			a_						:						Union[str, Any] 							= int(items[0])
			a_						:						int 							= int(items[1])

			if type_id == 0:
						if "bias" in name:
									assert value.shape == feature_extractor.conv_layers[layer_id].conv.bias.data.shape, (
									    f'''{full_name} has size {value.shape}, but'''
									    f''' {feature_extractor.conv_layers[layer_id].conv.bias.data.shape} was found.'''
									)
									a_						:						int 							= value
									logger.info(f'''Feat extract conv layer {layer_id} was initialized from {full_name}.''')
						elif "weight" in name:
									assert value.shape == feature_extractor.conv_layers[layer_id].conv.weight.data.shape, (
									    f'''{full_name} has size {value.shape}, but'''
									    f''' {feature_extractor.conv_layers[layer_id].conv.weight.data.shape} was found.'''
									)
									a_						:						List[str] 							= 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:
									assert value.shape == feature_extractor.conv_layers[layer_id].layer_norm.bias.data.shape, (
									    f'''{full_name} has size {value.shape}, but {feature_extractor[layer_id].layer_norm.bias.data.shape} was'''
									    " found."
									)
									a_						:						int 							= value
									logger.info(f'''Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.''')
						elif "weight" in name:
									assert value.shape == feature_extractor.conv_layers[layer_id].layer_norm.weight.data.shape, (
									    f'''{full_name} has size {value.shape}, but'''
									    f''' {feature_extractor[layer_id].layer_norm.weight.data.shape} was found.'''
									)
									a_						:						List[Any] 							= value
									logger.info(f'''Feat extract layer norm weight of layer {layer_id} was initialized from {full_name}.''')
			else:
						unused_weights.append(a__)


def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__):

			'''simple docstring'''



			a_						:						int 							= full_name.split("""adaptor.""")[-1]
			a_						:						List[str] 							= name.split(""".""")

			if items[1].isdigit():
						a_						:						Tuple 							= int(items[1])
			else:
						a_						:						str 							= None

			if "adaptor" not in full_name:
						if "proj_ln" in full_name:
									# has to be layer norm
									if "bias" in name:
												assert (
												    value.shape == adapter.proj_layer_norm.bias.data.shape
												), f'''{full_name} has size {value.shape}, but {adapter.proj_layer_norm.bias.data.shape} was found.'''
												a_						:						Optional[Any] 							= value
												logger.info(f'''Adapter proj layer norm bias was initialized from {full_name}.''')
									if "weight" in name:
												assert (
												    value.shape == adapter.proj_layer_norm.weight.data.shape
												), f'''{full_name} has size {value.shape}, but {adapter.proj_layer_norm.weight.data.shape} was found.'''
												a_						:						Any 							= value
						else:
									# has to be projection layer
									if "bias" in name:
												assert (
												    value.shape == adapter.proj.bias.data.shape
												), f'''{full_name} has size {value.shape}, but {adapter.proj.bias.data.shape} was found.'''
												a_						:						List[Any] 							= value
												logger.info(f'''Adapter proj layer bias was initialized from {full_name}.''')
									if "weight" in name:
												assert (
												    value.shape == adapter.proj.weight.data.shape
												), f'''{full_name} has size {value.shape}, but {adapter.proj.weight.data.shape} was found.'''
												a_						:						Tuple 							= value
												logger.info(f'''Adapter proj layer weight was initialized from {full_name}.''')
			elif isinstance(a__  ,	a__):
						if "bias" in name:
									assert (
									    value.shape == adapter.layers[layer_id].conv.bias.data.shape
									), f'''{full_name} has size {value.shape}, but {adapter.layers[layer_id].conv.bias.data.shape} was found.'''
									a_						:						List[Any] 							= value
									logger.info(f'''Adapter layer {layer_id} bias was initialized from {full_name}.''')
						elif "weight" in name:
									assert (
									    value.shape == adapter.layers[layer_id].conv.weight.data.shape
									), f'''{full_name} has size {value.shape}, but {adapter.layers[layer_id].conv.weight.data.shape} was found.'''
									a_						:						Dict 							= value
									logger.info(f'''Adapter layer {layer_id} bias was initialized from {full_name}.''')
			else:
						unused_weights.append(a__)


def 					_UpperCAmelCase				(						a__):

			'''simple docstring'''



			a_							,					a_						:						Dict 							= emb.weight.shape
			a_						:						Tuple 							= nn.Linear(a__  ,	a__  ,	bias=a__)
			a_						:						Tuple 							= emb.weight.data
			return lin_layer


@torch.no_grad()
def 					_UpperCAmelCase				(						a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	a__  ,	):

			'''simple docstring'''



			a_						:						int 							= WavaVecaConfig.from_pretrained(
			    a__  ,	add_adapter=a__  ,	adapter_stride=a__  ,	adapter_kernel_size=a__  ,	use_auth_token=a__  ,	output_hidden_size=a__  ,	)
			a_						:						int 							= MBartConfig.from_pretrained(a__)

			# load model
			a_							,					a_							,					a_						:						Any 							= fairseq.checkpoint_utils.load_model_ensemble_and_task(
			    [checkpoint_path]  ,	arg_overrides={
			        """config_yaml""": config_yaml_path,
			        """data""": """/""".join(dict_path.split("""/""")[:-1]),
			        """w2v_path""": checkpoint_path,
			        """load_pretrained_decoder_from""": None,
			    }  ,	)
			a_						:						int 							= model[0].eval()

			# load feature extractor
			a_						:						Dict 							= WavaVecaFeatureExtractor.from_pretrained(a__  ,	use_auth_token=a__)

			# set weights for wav2vec2 encoder
			a_						:						str 							= WavaVecaModel(a__)

			recursively_load_weights_wavaveca(model.encoder  ,	a__)

			# load decoder weights
			a_						:						Tuple 							= MBartForCausalLM(a__)
			a_							,					a_						:						Tuple 							= hf_decoder.model.decoder.load_state_dict(model.decoder.state_dict()  ,	strict=a__)
			logger.warning(f'''The following keys are missing when loading the decoder weights: {missing_keys}''')
			logger.warning(f'''The following keys are unexpected when loading the decoder weights: {unexpected_keys}''')

			a_						:						Optional[int] 							= SpeechEncoderDecoderModel(encoder=a__  ,	decoder=a__)
			a_						:						Any 							= False

			a_						:						List[str] 							= MBartaaTokenizer(a__)
			tokenizer.save_pretrained(a__)

			a_						:						str 							= hf_wavavec.config.to_dict()
			a_						:						Optional[int] 							= tokenizer.pad_token_id
			a_						:						List[Any] 							= tokenizer.bos_token_id
			a_						:						Tuple 							= tokenizer.eos_token_id
			a_						:						List[Any] 							= """mbart50"""
			a_						:						str 							= """wav2vec2"""

			a_						:						str 							= tokenizer.eos_token_id
			a_						:						Union[str, Any] 							= 2_5_0_0_0_4
			a_						:						List[str] 							= tokenizer.eos_token_id

			a_						:						Tuple 							= SpeechEncoderDecoderConfig.from_dict(a__)

			hf_wavavec.save_pretrained(a__)
			feature_extractor.save_pretrained(a__)


if __name__ == "__main__":
	__snake_case				:      str   		=			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_yaml_path""", default=None, type=str, help="""Path to yaml file of fine-tuned model""")
	parser.add_argument(
	    """--encoder_config_path""",
	    default="""facebook/wav2vec2-xls-r-1b""",
	    type=str,
	    help="""Path to hf encoder wav2vec2 checkpoint config""",
	)
	parser.add_argument(
	    """--decoder_config_path""",
	    default="""facebook/mbart-large-50-one-to-many-mmt""",
	    type=str,
	    help="""Path to hf decoder checkpoint config""",
	)
	parser.add_argument("""--add_adapter""", default=True, type=bool, help="""whethere to add model adapter layers""")
	parser.add_argument("""--adapter_stride""", default=2, type=int, help="""stride of adapter layers""")
	parser.add_argument("""--adapter_kernel_size""", default=3, type=int, help="""kernel size of adapter layers""")
	parser.add_argument("""--encoder_output_dim""", default=10_24, type=int, help="""encoder output dim""")
	parser.add_argument("""--start_token_id""", default=25_00_04, type=int, help="""`decoder_start_token_id` of model config""")

	__snake_case				:      int   		=			parser.parse_args()
	convert_wavaveca_checkpoint(
	    args.checkpoint_path,
	    args.pytorch_dump_folder_path,
	    args.dict_path,
	    args.config_yaml_path,
	    encoder_config_path=args.encoder_config_path,
	    decoder_config_path=args.decoder_config_path,
	    add_adapter=args.add_adapter,
	    adapter_kernel_size=args.adapter_kernel_size,
	    adapter_stride=args.adapter_stride,
	    decoder_start_token_id=args.start_token_id,
	    encoder_output_dim=args.encoder_output_dim,
	)





import importlib
import json
import os
from collections import OrderedDict
from typing import Dict, Optional, Union

# Build the list of all feature extractors
from ...configuration_utils import PretrainedConfig
from ...dynamic_module_utils import get_class_from_dynamic_module, resolve_trust_remote_code
from ...feature_extraction_utils import FeatureExtractionMixin
from ...utils import CONFIG_NAME, FEATURE_EXTRACTOR_NAME, get_file_from_repo, logging
from .auto_factory import _LazyAutoMapping
from .configuration_auto import (
    CONFIG_MAPPING_NAMES,
    AutoConfig,
    model_type_to_module_name,
    replace_list_option_in_docstrings,
)


__snake_case				:      Union[str, Any]   		=			logging.get_logger(__name__)

__snake_case				:      Tuple   		=			OrderedDict(
    [
        ("""audio-spectrogram-transformer""", """ASTFeatureExtractor"""),
        ("""beit""", """BeitFeatureExtractor"""),
        ("""chinese_clip""", """ChineseCLIPFeatureExtractor"""),
        ("""clap""", """ClapFeatureExtractor"""),
        ("""clip""", """CLIPFeatureExtractor"""),
        ("""clipseg""", """ViTFeatureExtractor"""),
        ("""conditional_detr""", """ConditionalDetrFeatureExtractor"""),
        ("""convnext""", """ConvNextFeatureExtractor"""),
        ("""cvt""", """ConvNextFeatureExtractor"""),
        ("""data2vec-audio""", """Wav2Vec2FeatureExtractor"""),
        ("""data2vec-vision""", """BeitFeatureExtractor"""),
        ("""deformable_detr""", """DeformableDetrFeatureExtractor"""),
        ("""deit""", """DeiTFeatureExtractor"""),
        ("""detr""", """DetrFeatureExtractor"""),
        ("""dinat""", """ViTFeatureExtractor"""),
        ("""donut-swin""", """DonutFeatureExtractor"""),
        ("""dpt""", """DPTFeatureExtractor"""),
        ("""encodec""", """EncodecFeatureExtractor"""),
        ("""flava""", """FlavaFeatureExtractor"""),
        ("""glpn""", """GLPNFeatureExtractor"""),
        ("""groupvit""", """CLIPFeatureExtractor"""),
        ("""hubert""", """Wav2Vec2FeatureExtractor"""),
        ("""imagegpt""", """ImageGPTFeatureExtractor"""),
        ("""layoutlmv2""", """LayoutLMv2FeatureExtractor"""),
        ("""layoutlmv3""", """LayoutLMv3FeatureExtractor"""),
        ("""levit""", """LevitFeatureExtractor"""),
        ("""maskformer""", """MaskFormerFeatureExtractor"""),
        ("""mctct""", """MCTCTFeatureExtractor"""),
        ("""mobilenet_v1""", """MobileNetV1FeatureExtractor"""),
        ("""mobilenet_v2""", """MobileNetV2FeatureExtractor"""),
        ("""mobilevit""", """MobileViTFeatureExtractor"""),
        ("""nat""", """ViTFeatureExtractor"""),
        ("""owlvit""", """OwlViTFeatureExtractor"""),
        ("""perceiver""", """PerceiverFeatureExtractor"""),
        ("""poolformer""", """PoolFormerFeatureExtractor"""),
        ("""regnet""", """ConvNextFeatureExtractor"""),
        ("""resnet""", """ConvNextFeatureExtractor"""),
        ("""segformer""", """SegformerFeatureExtractor"""),
        ("""sew""", """Wav2Vec2FeatureExtractor"""),
        ("""sew-d""", """Wav2Vec2FeatureExtractor"""),
        ("""speech_to_text""", """Speech2TextFeatureExtractor"""),
        ("""speecht5""", """SpeechT5FeatureExtractor"""),
        ("""swiftformer""", """ViTFeatureExtractor"""),
        ("""swin""", """ViTFeatureExtractor"""),
        ("""swinv2""", """ViTFeatureExtractor"""),
        ("""table-transformer""", """DetrFeatureExtractor"""),
        ("""timesformer""", """VideoMAEFeatureExtractor"""),
        ("""tvlt""", """TvltFeatureExtractor"""),
        ("""unispeech""", """Wav2Vec2FeatureExtractor"""),
        ("""unispeech-sat""", """Wav2Vec2FeatureExtractor"""),
        ("""van""", """ConvNextFeatureExtractor"""),
        ("""videomae""", """VideoMAEFeatureExtractor"""),
        ("""vilt""", """ViltFeatureExtractor"""),
        ("""vit""", """ViTFeatureExtractor"""),
        ("""vit_mae""", """ViTFeatureExtractor"""),
        ("""vit_msn""", """ViTFeatureExtractor"""),
        ("""wav2vec2""", """Wav2Vec2FeatureExtractor"""),
        ("""wav2vec2-conformer""", """Wav2Vec2FeatureExtractor"""),
        ("""wavlm""", """Wav2Vec2FeatureExtractor"""),
        ("""whisper""", """WhisperFeatureExtractor"""),
        ("""xclip""", """CLIPFeatureExtractor"""),
        ("""yolos""", """YolosFeatureExtractor"""),
    ]
)

__snake_case				:      List[Any]   		=			_LazyAutoMapping(CONFIG_MAPPING_NAMES, FEATURE_EXTRACTOR_MAPPING_NAMES)


def 					_UpperCAmelCase				(						a__):

			'''simple docstring'''



			for module_name, extractors in FEATURE_EXTRACTOR_MAPPING_NAMES.items():
						if class_name in extractors:
									a_						:						Tuple 							= model_type_to_module_name(a__)

									a_						:						Any 							= importlib.import_module(f'''.{module_name}'''  ,	"""transformers.models""")
									try:
												return getattr(a__  ,	a__)
									except AttributeError:
												continue

			for _, extractor in FEATURE_EXTRACTOR_MAPPING._extra_content.items():
						if getattr(a__  ,	"""__name__"""  ,	a__) == class_name:
									return extractor

    # We did not fine the class, but maybe it's because a dep is missing. In that case, the class will be in the main
    # init and we return the proper dummy to get an appropriate error message.
			a_						:						Tuple 							= importlib.import_module("""transformers""")
			if hasattr(a__  ,	a__):
						return getattr(a__  ,	a__)

			return None


def 					_UpperCAmelCase				(						a__  ,	a__ = None  ,	a__ = False  ,	a__ = False  ,	a__ = None  ,	a__ = None  ,	a__ = None  ,	a__ = False  ,	**a__  ,	):

			'''simple docstring'''



			a_						:						List[str] 							= get_file_from_repo(
			    a__  ,	a__  ,	cache_dir=a__  ,	force_download=a__  ,	resume_download=a__  ,	proxies=a__  ,	use_auth_token=a__  ,	revision=a__  ,	local_files_only=a__  ,	)
			if resolved_config_file is None:
						logger.info(
						    """Could not locate the feature extractor configuration file, will try to use the model config instead.""")
						return {}

			with open(a__  ,	encoding="""utf-8""") as reader:
						return json.load(a__)



class        A__:
						"""simple docstring"""






						def __init__(    self    )     -> List[str]:
									raise EnvironmentError(
									    """AutoFeatureExtractor is designed to be instantiated """
									    """using the `AutoFeatureExtractor.from_pretrained(pretrained_model_name_or_path)` method."""    )





						@classmethod
						@replace_list_option_in_docstrings(_lowercase    )
						def 			UpperCamelCase__					(    cls  ,      _lowercase  ,      **_lowercase    )     -> Dict:
									a_						:						Tuple 							= kwargs.pop("""config"""  ,      _lowercase    )
									a_						:						Dict 							= kwargs.pop("""trust_remote_code"""  ,      _lowercase    )
									a_						:						Dict 							= True

									a_							,					a_						:						List[str] 							= FeatureExtractionMixin.get_feature_extractor_dict(_lowercase  ,      **_lowercase    )
									a_						:						Tuple 							= config_dict.get("""feature_extractor_type"""  ,      _lowercase    )
									a_						:						List[Any] 							= None
									if "AutoFeatureExtractor" in config_dict.get("""auto_map"""  ,      {}    ):
												a_						:						Any 							= config_dict["""auto_map"""]["""AutoFeatureExtractor"""]

									# If we don't find the feature extractor class in the feature extractor config, let's try the model config.
									if feature_extractor_class is None and feature_extractor_auto_map is None:
												if not isinstance(_lowercase  ,      _lowercase    ):
															a_						:						List[str] 							= AutoConfig.from_pretrained(_lowercase  ,      **_lowercase    )
												# It could be in `config.feature_extractor_type``
												a_						:						List[Any] 							= getattr(_lowercase  ,      """feature_extractor_type"""  ,      _lowercase    )
												if hasattr(_lowercase  ,      """auto_map"""    ) and "AutoFeatureExtractor" in config.auto_map:
															a_						:						List[str] 							= config.auto_map["""AutoFeatureExtractor"""]

									if feature_extractor_class is not None:
												a_						:						int 							= feature_extractor_class_from_name(_lowercase    )

									a_						:						Dict 							= feature_extractor_auto_map is not None
									a_						:						Union[str, Any] 							= feature_extractor_class is not None or type(_lowercase    ) in FEATURE_EXTRACTOR_MAPPING
									a_						:						Optional[Any] 							= resolve_trust_remote_code(
									    _lowercase  ,      _lowercase  ,      _lowercase  ,      _lowercase    )

									if has_remote_code and trust_remote_code:
												a_						:						int 							= get_class_from_dynamic_module(
												    _lowercase  ,      _lowercase  ,      **_lowercase    )
												a_						:						Tuple 							= kwargs.pop("""code_revision"""  ,      _lowercase    )
												if os.path.isdir(_lowercase    ):
															feature_extractor_class.register_for_auto_class()
												return feature_extractor_class.from_dict(_lowercase  ,      **_lowercase    )
									elif feature_extractor_class is not None:
												return feature_extractor_class.from_dict(_lowercase  ,      **_lowercase    )
									# Last try: we use the FEATURE_EXTRACTOR_MAPPING.
									elif type(_lowercase    ) in FEATURE_EXTRACTOR_MAPPING:
												a_						:						List[str] 							= FEATURE_EXTRACTOR_MAPPING[type(_lowercase    )]
												return feature_extractor_class.from_dict(_lowercase  ,      **_lowercase    )

									raise ValueError(
									    F'''Unrecognized feature extractor in {pretrained_model_name_or_path}. Should have a '''
									    F'''`feature_extractor_type` key in its {FEATURE_EXTRACTOR_NAME} of {CONFIG_NAME}, or one of the following '''
									    F'''`model_type` keys in its {CONFIG_NAME}: {", ".join(c for c in FEATURE_EXTRACTOR_MAPPING_NAMES.keys()    )}'''    )





						@staticmethod
						def 			UpperCamelCase__					(    _lowercase  ,      _lowercase    )     -> List[Any]:
									FEATURE_EXTRACTOR_MAPPING.register(_lowercase  ,      _lowercase    )


