"""simple docstring"""





import inspect
import unittest
import warnings
from math import ceil, floor

from transformers import LevitConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
				import torch

				from transformers import (
				    MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
				    MODEL_MAPPING,
				    LevitForImageClassification,
				    LevitForImageClassificationWithTeacher,
				    LevitModel,
				)
				from transformers.models.levit.modeling_levit import LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
				from PIL import Image

				from transformers import LevitImageProcessor
class  _snake_case     (					a__		):






						def       lowerCamelCase__     (       self      :			int    ):
													__lowerCamelCase					:		str		   =     self.config_class(**self.inputs_dict    )
													self.parent.assertTrue(hasattr(UpperCAmelCase							,					"hidden_sizes"    )    )
													self.parent.assertTrue(hasattr(UpperCAmelCase							,					"num_attention_heads"    )    )

class  _snake_case     :






						def __init__(       self      :			Dict							,					UpperCAmelCase      :			Dict							,					UpperCAmelCase      :			Union[str, Any]=13							,					UpperCAmelCase      :			Any=64							,					UpperCAmelCase      :			str=3							,					UpperCAmelCase      :			Union[str, Any]=3							,					UpperCAmelCase      :			Union[str, Any]=2							,					UpperCAmelCase      :			Dict=1							,					UpperCAmelCase      :			Tuple=16							,					UpperCAmelCase      :			Optional[int]=[128, 256, 384]							,					UpperCAmelCase      :			str=[4, 6, 8]							,					UpperCAmelCase      :			Tuple=[2, 3, 4]							,					UpperCAmelCase      :			Dict=[16, 16, 16]							,					UpperCAmelCase      :			Union[str, Any]=0							,					UpperCAmelCase      :			List[Any]=[2, 2, 2]							,					UpperCAmelCase      :			Dict=[2, 2, 2]							,					UpperCAmelCase      :			str=0.0_2							,					UpperCAmelCase      :			Union[str, Any]=True							,					UpperCAmelCase      :			Optional[int]=True							,					UpperCAmelCase      :			List[Any]=2							,					):
													__lowerCamelCase					:		str		   =     parent
													__lowerCamelCase					:		Optional[Any]		   =     batch_size
													__lowerCamelCase					:		Dict		   =     image_size
													__lowerCamelCase					:		Optional[int]		   =     num_channels
													__lowerCamelCase					:		Any		   =     kernel_size
													__lowerCamelCase					:		Optional[Any]		   =     stride
													__lowerCamelCase					:		Optional[Any]		   =     padding
													__lowerCamelCase					:		List[str]		   =     hidden_sizes
													__lowerCamelCase					:		Union[str, Any]		   =     num_attention_heads
													__lowerCamelCase					:		Optional[Any]		   =     depths
													__lowerCamelCase					:		Dict		   =     key_dim
													__lowerCamelCase					:		Union[str, Any]		   =     drop_path_rate
													__lowerCamelCase					:		List[str]		   =     patch_size
													__lowerCamelCase					:		Any		   =     attention_ratio
													__lowerCamelCase					:		Optional[int]		   =     mlp_ratio
													__lowerCamelCase					:		Tuple		   =     initializer_range
													__lowerCamelCase					:		Tuple		   =     [
													    ["Subsample", key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
													    ["Subsample", key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
													]
													__lowerCamelCase					:		Optional[int]		   =     is_training
													__lowerCamelCase					:		Optional[int]		   =     use_labels
													__lowerCamelCase					:		Optional[Any]		   =     num_labels
													__lowerCamelCase					:		Union[str, Any]		   =     initializer_range






						def       lowerCamelCase__     (       self      :			List[Any]    ):
													__lowerCamelCase					:		int		   =     floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]    )

													__lowerCamelCase					:		Optional[int]		   =     None
													if self.use_labels:
																				__lowerCamelCase					:		Tuple		   =     ids_tensor([self.batch_size]							,					self.num_labels    )

													__lowerCamelCase					:		Dict		   =     self.get_config()
													return config, pixel_values, labels






						def       lowerCamelCase__     (       self      :			List[Any]    ):
													return LevitConfig(
													    image_size=self.image_size							,					num_channels=self.num_channels							,					kernel_size=self.kernel_size							,					stride=self.stride							,					padding=self.padding							,					patch_size=self.patch_size							,					hidden_sizes=self.hidden_sizes							,					num_attention_heads=self.num_attention_heads							,					depths=self.depths							,					key_dim=self.key_dim							,					drop_path_rate=self.drop_path_rate							,					mlp_ratio=self.mlp_ratio							,					attention_ratio=self.attention_ratio							,					initializer_range=self.initializer_range							,					down_ops=self.down_ops							,					)






						def       lowerCamelCase__     (       self      :			Tuple							,					UpperCAmelCase      :			Optional[Any]							,					UpperCAmelCase      :			str							,					UpperCAmelCase      :			Optional[Any]    ):
													__lowerCamelCase					:		Union[str, Any]		   =     LevitModel(config=UpperCAmelCase    )
													model.to(UpperCAmelCase    )
													model.eval()
													__lowerCamelCase					:		List[str]		   =     model(UpperCAmelCase    )
													__lowerCamelCase					:		int		   =     (self.image_size, self.image_size)
													__lowerCamelCase   ,  __lowerCamelCase					:		Dict		   =     image_size[0], image_size[1]
													for _ in range(4    ):
																				__lowerCamelCase					:		Union[str, Any]		   =     floor(((height + 2 * self.padding - self.kernel_size) / self.stride) + 1    )
																				__lowerCamelCase					:		Optional[int]		   =     floor(((width + 2 * self.padding - self.kernel_size) / self.stride) + 1    )
													self.parent.assertEqual(
													    result.last_hidden_state.shape							,					(self.batch_size, ceil(height / 4    ) * ceil(width / 4    ), self.hidden_sizes[-1])							,					)






						def       lowerCamelCase__     (       self      :			List[str]							,					UpperCAmelCase      :			Dict							,					UpperCAmelCase      :			int							,					UpperCAmelCase      :			str    ):
													__lowerCamelCase					:		str		   =     self.num_labels
													__lowerCamelCase					:		Tuple		   =     LevitForImageClassification(UpperCAmelCase    )
													model.to(UpperCAmelCase    )
													model.eval()
													__lowerCamelCase					:		Any		   =     model(UpperCAmelCase							,					labels=UpperCAmelCase    )
													self.parent.assertEqual(result.logits.shape							,					(self.batch_size, self.num_labels)    )







						def       lowerCamelCase__     (       self      :			Any    ):
													__lowerCamelCase					:		Union[str, Any]		   =     self.prepare_config_and_inputs()
													__lowerCamelCase   ,  __lowerCamelCase   ,  __lowerCamelCase					:		List[Any]		   =     config_and_inputs
													__lowerCamelCase					:		Optional[Any]		   =     {"pixel_values": pixel_values}
													return config, inputs_dict

@require_torch
class  _snake_case     (					a__				, a__				, unittest.TestCase		):
						snake_case__			  =			(
						    (LevitModel, LevitForImageClassification, LevitForImageClassificationWithTeacher)
						    if is_torch_available()
						    else ()
						)
						snake_case__			  =			(
						    {
						        "feature-extraction": LevitModel,
						        "image-classification": (LevitForImageClassification, LevitForImageClassificationWithTeacher),
						    }
						    if is_torch_available()
						    else {}
						)

						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False
						snake_case__			  =			False






						def       lowerCamelCase__     (       self      :			str    ):
													__lowerCamelCase					:		str		   =     LevitModelTester(self    )
													__lowerCamelCase					:		Tuple		   =     ConfigTester(self							,					config_class=UpperCAmelCase							,					has_text_modality=UpperCAmelCase							,					hidden_size=37    )






						def       lowerCamelCase__     (       self      :			str    ):
													self.create_and_test_config_common_properties()
													self.config_tester.create_and_test_config_to_json_string()
													self.config_tester.create_and_test_config_to_json_file()
													self.config_tester.create_and_test_config_from_and_save_pretrained()
													self.config_tester.create_and_test_config_with_num_labels()
													self.config_tester.check_config_can_be_init_without_params()
													self.config_tester.check_config_arguments_init()






						def       lowerCamelCase__     (       self      :			str    ):
													return






						@unittest.skip(reason="Levit does not use inputs_embeds"    )
						def       lowerCamelCase__     (       self      :			List[str]    ):
													pass






						@unittest.skip(reason="Levit does not support input and output embeddings"    )
						def       lowerCamelCase__     (       self      :			str    ):
													pass






						@unittest.skip(reason="Levit does not output attentions"    )
						def       lowerCamelCase__     (       self      :			List[Any]    ):
													pass






						def       lowerCamelCase__     (       self      :			Tuple    ):
													__lowerCamelCase   ,  __lowerCamelCase					:		Optional[int]		   =     self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowerCamelCase					:		Tuple		   =     model_class(UpperCAmelCase    )
																				__lowerCamelCase					:		int		   =     inspect.signature(model.forward    )
																				# signature.parameters is an OrderedDict => so arg_names order is deterministic
																				__lowerCamelCase					:		Optional[int]		   =     [*signature.parameters.keys()]

																				__lowerCamelCase					:		List[Any]		   =     ["pixel_values"]
																				self.assertListEqual(arg_names[:1]							,					UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			Tuple    ):
													def check_hidden_states_output(UpperCAmelCase      :			int							,					UpperCAmelCase      :			Optional[int]							,					UpperCAmelCase      :			Union[str, Any]    ):
																				__lowerCamelCase					:		Optional[Any]		   =     model_class(UpperCAmelCase    )
																				model.to(UpperCAmelCase    )
																				model.eval()

																				with torch.no_grad():
																											__lowerCamelCase					:		List[str]		   =     model(**self._prepare_for_class(UpperCAmelCase							,					UpperCAmelCase    )    )

																				__lowerCamelCase					:		str		   =     outputs.hidden_states

																				__lowerCamelCase					:		List[Any]		   =     len(self.model_tester.depths    ) + 1
																				self.assertEqual(len(UpperCAmelCase    )							,					UpperCAmelCase    )

																				__lowerCamelCase					:		Dict		   =     (self.model_tester.image_size, self.model_tester.image_size)
																				__lowerCamelCase   ,  __lowerCamelCase					:		Tuple		   =     image_size[0], image_size[1]
																				for _ in range(4    ):
																											__lowerCamelCase					:		List[str]		   =     floor(
																											    (
																											        (height + 2 * self.model_tester.padding - self.model_tester.kernel_size)
																											        / self.model_tester.stride
																											    )
																											    + 1    )
																											__lowerCamelCase					:		Any		   =     floor(
																											    (
																											        (width + 2 * self.model_tester.padding - self.model_tester.kernel_size)
																											        / self.model_tester.stride
																											    )
																											    + 1    )
																				# verify the first hidden states (first block)
																				self.assertListEqual(
																				    list(hidden_states[0].shape[-2:]    )							,					[
																				        height * width,
																				        self.model_tester.hidden_sizes[0],
																				    ]							,					)

													__lowerCamelCase   ,  __lowerCamelCase					:		Dict		   =     self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowerCamelCase					:		List[Any]		   =     True
																				check_hidden_states_output(UpperCAmelCase							,					UpperCAmelCase							,					UpperCAmelCase    )

																				# check that output_hidden_states also work using config
																				del inputs_dict["output_hidden_states"]
																				__lowerCamelCase					:		List[Any]		   =     True

																				check_hidden_states_output(UpperCAmelCase							,					UpperCAmelCase							,					UpperCAmelCase    )






						@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."    )
						def       lowerCamelCase__     (       self      :			Optional[int]    ):
													pass






						def       lowerCamelCase__     (       self      :			List[Any]							,					UpperCAmelCase      :			Dict							,					UpperCAmelCase      :			List[str]							,					UpperCAmelCase      :			str=False    ):
													__lowerCamelCase					:		Tuple		   =     super()._prepare_for_class(UpperCAmelCase							,					UpperCAmelCase							,					return_labels=UpperCAmelCase    )

													if return_labels:
																				if model_class.__name__ == "LevitForImageClassificationWithTeacher":
																											del inputs_dict["labels"]

													return inputs_dict






						def       lowerCamelCase__     (       self      :			Dict    ):
													__lowerCamelCase					:		Tuple		   =     self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_model(*UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			List[str]    ):
													__lowerCamelCase					:		Dict		   =     self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_image_classification(*UpperCAmelCase    )






						def       lowerCamelCase__     (       self      :			Any    ):
													if not self.model_tester.is_training:
																				return

													__lowerCamelCase   ,  __lowerCamelCase					:		Union[str, Any]		   =     self.model_tester.prepare_config_and_inputs_for_common()
													__lowerCamelCase					:		int		   =     True

													for model_class in self.all_model_classes:
																				# LevitForImageClassificationWithTeacher supports inference-only
																				if (
																				    model_class in get_values(UpperCAmelCase    )
																				    or model_class.__name__ == "LevitForImageClassificationWithTeacher"
																				):
																											continue
																				__lowerCamelCase					:		Optional[int]		   =     model_class(UpperCAmelCase    )
																				model.to(UpperCAmelCase    )
																				model.train()
																				__lowerCamelCase					:		Any		   =     self._prepare_for_class(UpperCAmelCase							,					UpperCAmelCase							,					return_labels=UpperCAmelCase    )
																				__lowerCamelCase					:		Union[str, Any]		   =     model(**UpperCAmelCase    ).loss
																				loss.backward()






						def       lowerCamelCase__     (       self      :			Optional[Any]    ):
													__lowerCamelCase   ,  __lowerCamelCase					:		Optional[int]		   =     self.model_tester.prepare_config_and_inputs_for_common()
													if not self.model_tester.is_training:
																				return

													__lowerCamelCase					:		int		   =     False
													__lowerCamelCase					:		int		   =     True

													for model_class in self.all_model_classes:
																				if model_class in get_values(UpperCAmelCase    ) or not model_class.supports_gradient_checkpointing:
																											continue
																				# LevitForImageClassificationWithTeacher supports inference-only
																				if model_class.__name__ == "LevitForImageClassificationWithTeacher":
																											continue
																				__lowerCamelCase					:		Optional[int]		   =     model_class(UpperCAmelCase    )
																				model.gradient_checkpointing_enable()
																				model.to(UpperCAmelCase    )
																				model.train()
																				__lowerCamelCase					:		Union[str, Any]		   =     self._prepare_for_class(UpperCAmelCase							,					UpperCAmelCase							,					return_labels=UpperCAmelCase    )
																				__lowerCamelCase					:		Optional[int]		   =     model(**UpperCAmelCase    ).loss
																				loss.backward()






						def       lowerCamelCase__     (       self      :			Tuple    ):
													__lowerCamelCase   ,  __lowerCamelCase					:		Union[str, Any]		   =     self.model_tester.prepare_config_and_inputs_for_common()

													__lowerCamelCase					:		Tuple		   =     [
													    {"title": "multi_label_classification", "num_labels": 2, "dtype": torch.float},
													    {"title": "single_label_classification", "num_labels": 1, "dtype": torch.long},
													    {"title": "regression", "num_labels": 1, "dtype": torch.float},
													]

													for model_class in self.all_model_classes:
																				if (
																				    model_class
																				    not in [
																				        *get_values(UpperCAmelCase    ),
																				    ]
																				    or model_class.__name__ == "LevitForImageClassificationWithTeacher"
																				):
																											continue

																				for problem_type in problem_types:
																											with self.subTest(msg=F"""Testing {model_class} with {problem_type["title"]}"""    ):
																																		__lowerCamelCase					:		List[str]		   =     problem_type["title"]
																																		__lowerCamelCase					:		List[str]		   =     problem_type["num_labels"]

																																		__lowerCamelCase					:		Union[str, Any]		   =     model_class(UpperCAmelCase    )
																																		model.to(UpperCAmelCase    )
																																		model.train()

																																		__lowerCamelCase					:		Dict		   =     self._prepare_for_class(UpperCAmelCase							,					UpperCAmelCase							,					return_labels=UpperCAmelCase    )

																																		if problem_type["num_labels"] > 1:
																																									__lowerCamelCase					:		Tuple		   =     inputs["labels"].unsqueeze(1    ).repeat(1							,					problem_type["num_labels"]    )

																																		__lowerCamelCase					:		List[Any]		   =     inputs["labels"].to(problem_type["dtype"]    )

																																		# This tests that we do not trigger the warning form PyTorch "Using a target size that is different
																																		# to the input size. This will likely lead to incorrect results due to broadcasting. Please ensure
																																		# they have the same size." which is a symptom something in wrong for the regression problem.
																																		# See https://github.com/huggingface/transformers/issues/11780
																																		with warnings.catch_warnings(record=UpperCAmelCase    ) as warning_list:
																																									__lowerCamelCase					:		str		   =     model(**UpperCAmelCase    ).loss
																																		for w in warning_list:
																																									if "Using a target size that is different to the input size" in str(w.message    ):
																																																raise ValueError(
																																																    F"""Something is going wrong in the regression problem: intercepted {w.message}"""    )

																																		loss.backward()







						@slow
						def       lowerCamelCase__     (       self      :			int    ):
													for model_name in LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				__lowerCamelCase					:		Dict		   =     LevitModel.from_pretrained(UpperCAmelCase    )
																				self.assertIsNotNone(UpperCAmelCase    )


def    lowercase_   (   ) ->      Optional[Any]:



							'''simple docstring'''

							__lowerCamelCase					:		str		   =     Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png"      )
							return image







@require_torch
@require_vision
class  _snake_case     (					unittest.TestCase		):






						@cached_property
						def       lowerCamelCase__     (       self      :			Optional[int]    ):
													return LevitImageProcessor.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]    )







						@slow
						def       lowerCamelCase__     (       self      :			List[str]    ):
													__lowerCamelCase					:		Tuple		   =     LevitForImageClassificationWithTeacher.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]    ).to(
													    UpperCAmelCase    )

													__lowerCamelCase					:		Union[str, Any]		   =     self.default_image_processor
													__lowerCamelCase					:		Optional[int]		   =     prepare_img()
													__lowerCamelCase					:		Optional[int]		   =     image_processor(images=UpperCAmelCase							,					return_tensors="pt"    ).to(UpperCAmelCase    )

													# forward pass
													with torch.no_grad():
																				__lowerCamelCase					:		List[str]		   =     model(**UpperCAmelCase    )

													# verify the logits
													__lowerCamelCase					:		int		   =     torch.Size((1, 1000)    )
													self.assertEqual(outputs.logits.shape							,					UpperCAmelCase    )

													__lowerCamelCase					:		Optional[Any]		   =     torch.tensor([1.0_4_4_8, -0.3_7_4_5, -1.8_3_1_7]    ).to(UpperCAmelCase    )

													self.assertTrue(torch.allclose(outputs.logits[0, :3]							,					UpperCAmelCase							,					atol=1E-4    )    )
"""simple docstring"""





import argparse

import numpy as np
import torch

from transformers import SpeechTaHifiGan, SpeechTaHifiGanConfig, logging


logging.set_verbosity_info()
__A  =				logging.get_logger('''transformers.models.speecht5''')


def    lowercase_   (   _lowerCamelCase:	Any						,   _lowerCamelCase:	List[Any]						,   _lowerCamelCase:	Tuple      ) ->      Union[str, Any]:



							'''simple docstring'''

							hf_model.apply_weight_norm()

							__lowerCamelCase					:		Union[str, Any]		   =     checkpoint["input_conv.weight_g"]
							__lowerCamelCase					:		int		   =     checkpoint["input_conv.weight_v"]
							__lowerCamelCase					:		Dict		   =     checkpoint["input_conv.bias"]

							for i in range(len(config.upsample_rates      )      ):
														__lowerCamelCase					:		Dict		   =     checkpoint[F"""upsamples.{i}.1.weight_g"""]
														__lowerCamelCase					:		Optional[int]		   =     checkpoint[F"""upsamples.{i}.1.weight_v"""]
														__lowerCamelCase					:		Any		   =     checkpoint[F"""upsamples.{i}.1.bias"""]

							for i in range(len(config.upsample_rates      ) * len(config.resblock_kernel_sizes      )      ):
														for j in range(len(config.resblock_dilation_sizes      )      ):
																					__lowerCamelCase					:		List[str]		   =     checkpoint[F"""blocks.{i}.convs1.{j}.1.weight_g"""]
																					__lowerCamelCase					:		str		   =     checkpoint[F"""blocks.{i}.convs1.{j}.1.weight_v"""]
																					__lowerCamelCase					:		Union[str, Any]		   =     checkpoint[F"""blocks.{i}.convs1.{j}.1.bias"""]

																					__lowerCamelCase					:		str		   =     checkpoint[F"""blocks.{i}.convs2.{j}.1.weight_g"""]
																					__lowerCamelCase					:		int		   =     checkpoint[F"""blocks.{i}.convs2.{j}.1.weight_v"""]
																					__lowerCamelCase					:		int		   =     checkpoint[F"""blocks.{i}.convs2.{j}.1.bias"""]

							__lowerCamelCase					:		Any		   =     checkpoint["output_conv.1.weight_g"]
							__lowerCamelCase					:		Tuple		   =     checkpoint["output_conv.1.weight_v"]
							__lowerCamelCase					:		int		   =     checkpoint["output_conv.1.bias"]

							hf_model.remove_weight_norm()


@torch.no_grad()
def    lowercase_   (   _lowerCamelCase:	Optional[Any]						,   _lowerCamelCase:	Dict						,   _lowerCamelCase:	Optional[int]						,   _lowerCamelCase:	Any=None						,   _lowerCamelCase:	Optional[int]=None						,   ) ->      Optional[int]:



							'''simple docstring'''

							if config_path is not None:
														__lowerCamelCase					:		Dict		   =     SpeechTaHifiGanConfig.from_pretrained(_lowerCamelCase      )
							else:
														__lowerCamelCase					:		Tuple		   =     SpeechTaHifiGanConfig()

							__lowerCamelCase					:		List[Any]		   =     SpeechTaHifiGan(_lowerCamelCase      )

							__lowerCamelCase					:		int		   =     torch.load(_lowerCamelCase      )
							load_weights(orig_checkpoint["model"]["generator"]						,   _lowerCamelCase						,   _lowerCamelCase      )

							__lowerCamelCase					:		Dict		   =     np.load(_lowerCamelCase      )
							__lowerCamelCase					:		List[str]		   =     stats[0].reshape(-1      )
							__lowerCamelCase					:		Optional[int]		   =     stats[1].reshape(-1      )
							__lowerCamelCase					:		int		   =     torch.from_numpy(_lowerCamelCase      ).float()
							__lowerCamelCase					:		List[str]		   =     torch.from_numpy(_lowerCamelCase      ).float()

							model.save_pretrained(_lowerCamelCase      )

							if repo_id:
														print("Pushing to the hub..."      )
														model.push_to_hub(_lowerCamelCase      )


if __name__ == "__main__":
				__A  =				argparse.ArgumentParser()
				parser.add_argument('''--checkpoint_path''', required=True, default=None, type=str, help='''Path to original checkpoint''')
				parser.add_argument('''--stats_path''', required=True, default=None, type=str, help='''Path to stats.npy file''')
				parser.add_argument('''--config_path''', default=None, type=str, help='''Path to hf config.json of model to convert''')
				parser.add_argument(
				    '''--pytorch_dump_folder_path''', required=True, default=None, type=str, help='''Path to the output PyTorch model.'''
				)
				parser.add_argument(
				    '''--push_to_hub''', default=None, type=str, help='''Where to upload the converted model on the 🤗 hub.'''
				)

				__A  =				parser.parse_args()
				convert_hifigan_checkpoint(
				    args.checkpoint_path,
				    args.stats_path,
				    args.pytorch_dump_folder_path,
				    args.config_path,
				    args.push_to_hub,
				)