
import gc
import unittest

import numpy as np
import torch
import torch.nn.functional as F
from transformers import (
    ClapTextConfig,
    ClapTextModelWithProjection,
    RobertaTokenizer,
    SpeechTaHifiGan,
    SpeechTaHifiGanConfig,
)

from diffusers import (
    AudioLDMPipeline,
    AutoencoderKL,
    DDIMScheduler,
    LMSDiscreteScheduler,
    PNDMScheduler,
    UNetaDConditionModel,
)
from diffusers.utils import is_xformers_available, slow, torch_device
from diffusers.utils.testing_utils import enable_full_determinism

from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
from ..test_pipelines_common import PipelineTesterMixin


enable_full_determinism()






class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_   ,		unittest.TestCase    ):

							"""simple docstring"""






							_snake_case     		=  AudioLDMPipeline
							_snake_case     		=  TEXT_TO_AUDIO_PARAMS
							_snake_case     		=  TEXT_TO_AUDIO_BATCH_PARAMS
							_snake_case     		=  frozenset(
							    [
							        'num_inference_steps',
							        'num_waveforms_per_prompt',
							        'generator',
							        'latents',
							        'output_type',
							        'return_dict',
							        'callback',
							        'callback_steps',
							    ]    )



							def     A__		(  self			)->   Optional[int]:





													'''simple docstring'''






													torch.manual_seed(0			)
													__UpperCamelCase       =			UNetaDConditionModel(
													    block_out_channels=(32, 64)     ,	layers_per_block=2     ,	sample_size=32     ,	in_channels=4     ,	out_channels=4     ,	down_block_types=('''DownBlock2D''', '''CrossAttnDownBlock2D''')     ,	up_block_types=('''CrossAttnUpBlock2D''', '''UpBlock2D''')     ,	cross_attention_dim=(32, 64)     ,	class_embed_type='''simple_projection'''     ,	projection_class_embeddings_input_dim=32     ,	class_embeddings_concat=SCREAMING_SNAKE_CASE_     ,	)
													__UpperCamelCase       =			DDIMScheduler(
													    beta_start=0.0_0_0_8_5     ,	beta_end=0.0_1_2     ,	beta_schedule='''scaled_linear'''     ,	clip_sample=SCREAMING_SNAKE_CASE_     ,	set_alpha_to_one=SCREAMING_SNAKE_CASE_     ,	)
													torch.manual_seed(0			)
													__UpperCamelCase       =			AutoencoderKL(
													    block_out_channels=[32, 64]     ,	in_channels=1     ,	out_channels=1     ,	down_block_types=['''DownEncoderBlock2D''', '''DownEncoderBlock2D''']     ,	up_block_types=['''UpDecoderBlock2D''', '''UpDecoderBlock2D''']     ,	latent_channels=4     ,	)
													torch.manual_seed(0			)
													__UpperCamelCase       =			ClapTextConfig(
													    bos_token_id=0     ,	eos_token_id=2     ,	hidden_size=32     ,	intermediate_size=37     ,	layer_norm_eps=1E-05     ,	num_attention_heads=4     ,	num_hidden_layers=5     ,	pad_token_id=1     ,	vocab_size=1000     ,	projection_dim=32     ,	)
													__UpperCamelCase       =			ClapTextModelWithProjection(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			RobertaTokenizer.from_pretrained('''hf-internal-testing/tiny-random-roberta'''     ,	model_max_length=77			)

													__UpperCamelCase       =			SpeechTaHifiGanConfig(
													    model_in_dim=8     ,	sampling_rate=16000     ,	upsample_initial_channel=16     ,	upsample_rates=[2, 2]     ,	upsample_kernel_sizes=[4, 4]     ,	resblock_kernel_sizes=[3, 7]     ,	resblock_dilation_sizes=[[1, 3, 5], [1, 3, 5]]     ,	normalize_before=SCREAMING_SNAKE_CASE_     ,	)

													__UpperCamelCase       =			SpeechTaHifiGan(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			{
													    '''unet''': unet,
													    '''scheduler''': scheduler,
													    '''vae''': vae,
													    '''text_encoder''': text_encoder,
													    '''tokenizer''': tokenizer,
													    '''vocoder''': vocoder,
													}
													return components



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_=0			)->   int:





													'''simple docstring'''






													if str(SCREAMING_SNAKE_CASE_			).startswith('''mps'''			):
																			__UpperCamelCase       =			torch.manual_seed(SCREAMING_SNAKE_CASE_			)
													else:
																			__UpperCamelCase       =			torch.Generator(device=SCREAMING_SNAKE_CASE_			).manual_seed(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{
													    '''prompt''': '''A hammer hitting a wooden surface''',
													    '''generator''': generator,
													    '''num_inference_steps''': 2,
													    '''guidance_scale''': 6.0,
													}
													return inputs



							def     A__		(  self			)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator

													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) == 256

													__UpperCamelCase       =			audio[:10]
													__UpperCamelCase       =			np.array(
													    [-0.0_0_5_0, 0.0_0_5_0, -0.0_0_6_0, 0.0_0_3_3, -0.0_0_2_6, 0.0_0_3_3, -0.0_0_2_7, 0.0_0_3_3, -0.0_0_2_8, 0.0_0_3_3]			)

													assert np.abs(audio_slice - expected_slice			).max() < 1E-2



							def     A__		(  self			)->   str:





													'''simple docstring'''






													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			3 * [inputs['''prompt''']]

													# forward
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			3 * [inputs.pop('''prompt'''			)]

													__UpperCamelCase       =			audioldm_pipe.tokenizer(
													    SCREAMING_SNAKE_CASE_     ,	padding='''max_length'''     ,	max_length=audioldm_pipe.tokenizer.model_max_length     ,	truncation=SCREAMING_SNAKE_CASE_     ,	return_tensors='''pt'''     ,	)
													__UpperCamelCase       =			text_inputs['''input_ids'''].to(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			audioldm_pipe.text_encoder(
													    SCREAMING_SNAKE_CASE_     ,	)
													__UpperCamelCase       =			prompt_embeds.text_embeds
													# additional L_2 normalization over each hidden-state
													__UpperCamelCase       =			F.normalize(SCREAMING_SNAKE_CASE_     ,	dim=-1			)

													__UpperCamelCase       =			prompt_embeds

													# forward
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert np.abs(audio_a - audio_a			).max() < 1E-2



							def     A__		(  self			)->   Tuple:





													'''simple docstring'''






													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			3 * ['''this is a negative prompt''']
													__UpperCamelCase       =			negative_prompt
													__UpperCamelCase       =			3 * [inputs['''prompt''']]

													# forward
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			3 * [inputs.pop('''prompt'''			)]

													__UpperCamelCase       =			[]
													for p in [prompt, negative_prompt]:
																			__UpperCamelCase       =			audioldm_pipe.tokenizer(
																			    SCREAMING_SNAKE_CASE_     ,	padding='''max_length'''     ,	max_length=audioldm_pipe.tokenizer.model_max_length     ,	truncation=SCREAMING_SNAKE_CASE_     ,	return_tensors='''pt'''     ,	)
																			__UpperCamelCase       =			text_inputs['''input_ids'''].to(SCREAMING_SNAKE_CASE_			)

																			__UpperCamelCase       =			audioldm_pipe.text_encoder(
																			    SCREAMING_SNAKE_CASE_     ,	)
																			__UpperCamelCase       =			text_embeds.text_embeds
																			# additional L_2 normalization over each hidden-state
																			__UpperCamelCase       =			F.normalize(SCREAMING_SNAKE_CASE_     ,	dim=-1			)

																			embeds.append(SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase  ,							__UpperCamelCase       =			embeds

													# forward
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert np.abs(audio_a - audio_a			).max() < 1E-2



							def     A__		(  self			)->   Tuple:





													'''simple docstring'''






													__UpperCamelCase       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator
													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			PNDMScheduler(skip_prk_steps=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			'''egg cracking'''
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_     ,	negative_prompt=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) == 256

													__UpperCamelCase       =			audio[:10]
													__UpperCamelCase       =			np.array(
													    [-0.0_0_5_1, 0.0_0_5_0, -0.0_0_6_0, 0.0_0_3_4, -0.0_0_2_6, 0.0_0_3_3, -0.0_0_2_7, 0.0_0_3_3, -0.0_0_2_8, 0.0_0_3_2]			)

													assert np.abs(audio_slice - expected_slice			).max() < 1E-2



							def     A__		(  self			)->   Tuple:





													'''simple docstring'''






													__UpperCamelCase       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator
													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			PNDMScheduler(skip_prk_steps=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			'''A hammer hitting a wooden surface'''

													# test num_waveforms_per_prompt=1 (default)
													__UpperCamelCase       =			audioldm_pipe(SCREAMING_SNAKE_CASE_     ,	num_inference_steps=2			).audios

													assert audios.shape == (1, 256)

													# test num_waveforms_per_prompt=1 (default) for batch of prompts
													__UpperCamelCase       =			2
													__UpperCamelCase       =			audioldm_pipe([prompt] * batch_size     ,	num_inference_steps=2			).audios

													assert audios.shape == (batch_size, 256)

													# test num_waveforms_per_prompt for single prompt
													__UpperCamelCase       =			2
													__UpperCamelCase       =			audioldm_pipe(SCREAMING_SNAKE_CASE_     ,	num_inference_steps=2     ,	num_waveforms_per_prompt=SCREAMING_SNAKE_CASE_			).audios

													assert audios.shape == (num_waveforms_per_prompt, 256)

													# test num_waveforms_per_prompt for batch of prompts
													__UpperCamelCase       =			2
													__UpperCamelCase       =			audioldm_pipe(
													    [prompt] * batch_size     ,	num_inference_steps=2     ,	num_waveforms_per_prompt=SCREAMING_SNAKE_CASE_			).audios

													assert audios.shape == (batch_size * num_waveforms_per_prompt, 256)



							def     A__		(  self			)->   Dict:





													'''simple docstring'''






													__UpperCamelCase       =			'''cpu'''  # ensure determinism for the device-dependent torch.Generator
													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.vocoder.config.sampling_rate

													__UpperCamelCase       =			self.get_dummy_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe(audio_length_in_s=0.0_1_6     ,	**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) / vocoder_sampling_rate == 0.0_1_6

													__UpperCamelCase       =			audioldm_pipe(audio_length_in_s=0.0_3_2     ,	**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			output.audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) / vocoder_sampling_rate == 0.0_3_2



							def     A__		(  self			)->   Any:





													'''simple docstring'''






													__UpperCamelCase       =			self.get_dummy_components()
													__UpperCamelCase       =			AudioLDMPipeline(**SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			['''hey''']

													__UpperCamelCase       =			audioldm_pipe(SCREAMING_SNAKE_CASE_     ,	num_inference_steps=1			)
													__UpperCamelCase       =			output.audios.shape
													assert audio_shape == (1, 256)

													__UpperCamelCase       =			audioldm_pipe.vocoder.config
													config.model_in_dim *= 2
													__UpperCamelCase       =			SpeechTaHifiGan(SCREAMING_SNAKE_CASE_			).to(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe(SCREAMING_SNAKE_CASE_     ,	num_inference_steps=1			)
													__UpperCamelCase       =			output.audios.shape
													# waveform shape is unchanged, we just have 2x the number of mel channels in the spectrogram
													assert audio_shape == (1, 256)



							def     A__		(  self			)->   Any:





													'''simple docstring'''






													self._test_attention_slicing_forward_pass(test_mean_pixel_difference=SCREAMING_SNAKE_CASE_			)



							def     A__		(  self			)->   List[str]:





													'''simple docstring'''






													self._test_inference_batch_single_identical(test_mean_pixel_difference=SCREAMING_SNAKE_CASE_			)



							@unittest.skipIf(
							    torch_device != '''cuda''' or not is_xformers_available()     ,	reason='''XFormers attention is only available with CUDA and `xformers` installed'''     ,	)
							def     A__		(  self			)->   Dict:





													'''simple docstring'''






													self._test_xformers_attention_forwardGenerator_pass(test_mean_pixel_difference=SCREAMING_SNAKE_CASE_			)






@slow
class        SCREAMING_SNAKE_CASE__    (							unittest.TestCase    ):

							"""simple docstring"""






							def     A__		(  self			)->   Dict:





													'''simple docstring'''






													super().tearDown()
													gc.collect()
													torch.cuda.empty_cache()



							def     A__		(  self     ,	SCREAMING_SNAKE_CASE_     ,	SCREAMING_SNAKE_CASE_="cpu"     ,	SCREAMING_SNAKE_CASE_=torch.floataa     ,	SCREAMING_SNAKE_CASE_=0			)->   int:





													'''simple docstring'''






													__UpperCamelCase       =			torch.Generator(device=SCREAMING_SNAKE_CASE_			).manual_seed(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			np.random.RandomState(SCREAMING_SNAKE_CASE_			).standard_normal((1, 8, 128, 16)			)
													__UpperCamelCase       =			torch.from_numpy(SCREAMING_SNAKE_CASE_			).to(device=SCREAMING_SNAKE_CASE_     ,	dtype=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			{
													    '''prompt''': '''A hammer hitting a wooden surface''',
													    '''latents''': latents,
													    '''generator''': generator,
													    '''num_inference_steps''': 3,
													    '''guidance_scale''': 2.5,
													}
													return inputs



							def     A__		(  self			)->   Dict:





													'''simple docstring'''






													__UpperCamelCase       =			AudioLDMPipeline.from_pretrained('''cvssp/audioldm'''			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			25
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			).audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) == 81920

													__UpperCamelCase       =			audio[77230:77240]
													__UpperCamelCase       =			np.array(
													    [-0.4_8_8_4, -0.4_6_0_7, 0.0_0_2_3, 0.5_0_0_7, 0.5_8_9_6, 0.5_1_5_1, 0.3_8_1_3, -0.0_2_0_8, -0.3_6_8_7, -0.4_3_1_5]			)
													__UpperCamelCase       =			np.abs(expected_slice - audio_slice			).max()
													assert max_diff < 1E-2



							def     A__		(  self			)->   List[Any]:





													'''simple docstring'''






													__UpperCamelCase       =			AudioLDMPipeline.from_pretrained('''cvssp/audioldm'''			)
													__UpperCamelCase       =			LMSDiscreteScheduler.from_config(audioldm_pipe.scheduler.config			)
													__UpperCamelCase       =			audioldm_pipe.to(SCREAMING_SNAKE_CASE_			)
													audioldm_pipe.set_progress_bar_config(disable=SCREAMING_SNAKE_CASE_			)

													__UpperCamelCase       =			self.get_inputs(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			audioldm_pipe(**SCREAMING_SNAKE_CASE_			).audios[0]

													assert audio.ndim == 1
													assert len(SCREAMING_SNAKE_CASE_			) == 81920

													__UpperCamelCase       =			audio[27780:27790]
													__UpperCamelCase       =			np.array([-0.2_1_3_1, -0.0_8_7_3, -0.0_1_2_4, -0.0_1_8_9, 0.0_5_6_9, 0.1_3_7_3, 0.1_8_8_3, 0.2_8_8_6, 0.3_2_9_7, 0.2_2_1_2]			)
													__UpperCamelCase       =			np.abs(expected_slice - audio_slice			).max()
													assert max_diff < 3E-2






from ....configuration_utils import PretrainedConfig
from ....utils import logging


lowercase__							:							Tuple									=			logging.get_logger(__name__)

lowercase__							:							Union[str, Any]									=			{
    "speechbrain/m-ctc-t-large": "https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json",
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}






class        SCREAMING_SNAKE_CASE__    (							SCREAMING_SNAKE_CASE_    ):

							"""simple docstring"""






							_snake_case     		=  'mctct'



							def __init__(  self     ,	SCREAMING_SNAKE_CASE_=8065     ,	SCREAMING_SNAKE_CASE_=1536     ,	SCREAMING_SNAKE_CASE_=36     ,	SCREAMING_SNAKE_CASE_=6144     ,	SCREAMING_SNAKE_CASE_=4     ,	SCREAMING_SNAKE_CASE_=384     ,	SCREAMING_SNAKE_CASE_=920     ,	SCREAMING_SNAKE_CASE_=1E-5     ,	SCREAMING_SNAKE_CASE_=0.3     ,	SCREAMING_SNAKE_CASE_="relu"     ,	SCREAMING_SNAKE_CASE_=0.0_2     ,	SCREAMING_SNAKE_CASE_=0.3     ,	SCREAMING_SNAKE_CASE_=0.3     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=0     ,	SCREAMING_SNAKE_CASE_=2     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=0.3     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=(7,)     ,	SCREAMING_SNAKE_CASE_=(3,)     ,	SCREAMING_SNAKE_CASE_=80     ,	SCREAMING_SNAKE_CASE_=1     ,	SCREAMING_SNAKE_CASE_=None     ,	SCREAMING_SNAKE_CASE_="sum"     ,	SCREAMING_SNAKE_CASE_=False     ,	**SCREAMING_SNAKE_CASE_     ,	)->   Tuple:





													'''simple docstring'''






													super().__init__(**SCREAMING_SNAKE_CASE_     ,	pad_token_id=SCREAMING_SNAKE_CASE_     ,	bos_token_id=SCREAMING_SNAKE_CASE_     ,	eos_token_id=SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			vocab_size
													__UpperCamelCase       =			hidden_size
													__UpperCamelCase       =			num_hidden_layers
													__UpperCamelCase       =			intermediate_size
													__UpperCamelCase       =			num_attention_heads
													__UpperCamelCase       =			attention_head_dim
													__UpperCamelCase       =			max_position_embeddings
													__UpperCamelCase       =			layer_norm_eps
													__UpperCamelCase       =			layerdrop
													__UpperCamelCase       =			hidden_act
													__UpperCamelCase       =			initializer_range
													__UpperCamelCase       =			hidden_dropout_prob
													__UpperCamelCase       =			attention_probs_dropout_prob
													__UpperCamelCase       =			pad_token_id
													__UpperCamelCase       =			bos_token_id
													__UpperCamelCase       =			eos_token_id
													__UpperCamelCase       =			conv_glu_dim
													__UpperCamelCase       =			conv_dropout
													__UpperCamelCase       =			num_conv_layers
													__UpperCamelCase       =			input_feat_per_channel
													__UpperCamelCase       =			input_channels
													__UpperCamelCase       =			conv_channels
													__UpperCamelCase       =			ctc_loss_reduction
													__UpperCamelCase       =			ctc_zero_infinity

													# prevents config testing fail with exporting to json
													__UpperCamelCase       =			list(SCREAMING_SNAKE_CASE_			)
													__UpperCamelCase       =			list(SCREAMING_SNAKE_CASE_			)

													if len(self.conv_kernel			) != self.num_conv_layers:
																			raise ValueError(
																			    '''Configuration for convolutional module is incorrect. '''
																			    '''It is required that `len(config.conv_kernel)` == `config.num_conv_layers` '''
																			    F"but is `len(config.conv_kernel) = {len(self.conv_kernel			)}`, "
																			    F"`config.num_conv_layers = {self.num_conv_layers}`."			)




