




"""simple docstring"""




import pytest

import datasets


# Import fixture modules as plugins
lowerCAmelCase				:     Optional[int]					=				["""tests.fixtures.files""", """tests.fixtures.hub""", """tests.fixtures.fsspec"""]



def        a__					(							snake_case__			,					snake_case__							)		->   List[str]:
			# Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
			for item in items:
						if any(marker in item.keywords for marker in ["""integration""", """unit"""]							):
									continue
						item.add_marker(pytest.mark.unit							)



def        a__					(							snake_case__							)		->   Union[str, Any]:
			config.addinivalue_line("""markers"""			,					"""torchaudio_latest: mark test to run with torchaudio>=0.12"""							)



@pytest.fixture(autouse=snake_case__							)
def        a__					(							snake_case__			,					snake_case__							)		->   Dict:
			# test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
			lowerCamelCase      =   tmp_path_factory.getbasetemp() / """cache"""
			lowerCamelCase      =   test_hf_cache_home / """datasets"""
			lowerCamelCase      =   test_hf_cache_home / """metrics"""
			lowerCamelCase      =   test_hf_cache_home / """modules"""
			monkeypatch.setattr("""datasets.config.HF_DATASETS_CACHE"""			,					str(snake_case__							)							)
			monkeypatch.setattr("""datasets.config.HF_METRICS_CACHE"""			,					str(snake_case__							)							)
			monkeypatch.setattr("""datasets.config.HF_MODULES_CACHE"""			,					str(snake_case__							)							)
			lowerCamelCase      =   test_hf_datasets_cache / """downloads"""
			monkeypatch.setattr("""datasets.config.DOWNLOADED_DATASETS_PATH"""			,					str(snake_case__							)							)
			lowerCamelCase      =   test_hf_datasets_cache / """downloads""" / """extracted"""
			monkeypatch.setattr("""datasets.config.EXTRACTED_DATASETS_PATH"""			,					str(snake_case__							)							)



@pytest.fixture(autouse=snake_case__			,					scope="""session"""							)
def        a__					(							)		->   str:
			datasets.disable_progress_bar()



@pytest.fixture(autouse=snake_case__							)
def        a__					(							snake_case__							)		->   int:
			# don't take tests into account when counting downloads
			monkeypatch.setattr("""datasets.config.HF_UPDATE_DOWNLOAD_COUNTS"""			,					snake_case__							)



@pytest.fixture
def        a__					(							snake_case__							)		->   str:
			# Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
			# To be removed once SQLAlchemy 2.0 supported
			monkeypatch.setattr("""sqlalchemy.util.deprecations.SILENCE_UBER_WARNING"""			,					snake_case__							)









"""simple docstring"""




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


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

lowerCAmelCase				:     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        __magic_name__				(			UpperCAmelCase__							):






				'''simple docstring'''
				__UpperCamelCase         =		"mctct"





				def __init__(			self						,					_a=8_065						,					_a=1_536						,					_a=36						,					_a=6_144						,					_a=4						,					_a=384						,					_a=920						,					_a=1e-5						,					_a=0.3						,					_a="relu"						,					_a=0.02						,					_a=0.3						,					_a=0.3						,					_a=1						,					_a=0						,					_a=2						,					_a=1						,					_a=0.3						,					_a=1						,					_a=(7,)						,					_a=(3,)						,					_a=80						,					_a=1						,					_a=None						,					_a="sum"						,					_a=False						,					**_a						,					):





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

							# prevents config testing fail with exporting to json
							lowerCamelCase      =   list(_a					)
							lowerCamelCase      =   list(_a					)

							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}`.'					)



