
import unittest

from transformers import DebertaVaTokenizer, DebertaVaTokenizerFast
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


lowercase_ 				=			get_tests_dir("""fixtures/spiece.model""")





@require_sentencepiece
@require_tokenizers
class     __UpperCamelCase (							lowerCAmelCase__ ,						unittest.TestCase       ):






     """simple docstring"""







     lowerCAmelCase_							   =			DebertaVaTokenizer
     lowerCAmelCase_							   =			DebertaVaTokenizerFast
     lowerCAmelCase_							   =			True
     lowerCAmelCase_							   =			True



     def  UpperCAmelCase__							(				self							:							Dict ):







       """simple docstring"""




       super().setUp()

       # We have a SentencePiece fixture for testing
       __SCREAMING_SNAKE_CASE      :	str					=		DebertaVaTokenizer(_A     ,						unk_token='''<unk>''' )
       tokenizer.save_pretrained(self.tmpdirname )



     def  UpperCAmelCase__							(				self							:							Union[str, Any]     ,						_A							:							List[Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	str					=		'''this is a test'''
       __SCREAMING_SNAKE_CASE      :	Dict					=		'''this is a test'''
       return input_text, output_text



     def  UpperCAmelCase__							(				self							:							Dict ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		'''<pad>'''
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		0

       self.assertEqual(self.get_tokenizer()._convert_token_to_id(_A )     ,						_A )
       self.assertEqual(self.get_tokenizer()._convert_id_to_token(_A )     ,						_A )



     def  UpperCAmelCase__							(				self							:							Tuple ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		list(self.get_tokenizer().get_vocab().keys() )
       self.assertEqual(vocab_keys[0]     ,						'''<pad>''' )
       self.assertEqual(vocab_keys[1]     ,						'''<unk>''' )
       self.assertEqual(vocab_keys[-1]     ,						'''[PAD]''' )
       self.assertEqual(len(_A )     ,						3_0001 )



     def  UpperCAmelCase__							(				self							:							List[Any] ):







       """simple docstring"""




       self.assertEqual(self.get_tokenizer().vocab_size     ,						3_0000 )



     def  UpperCAmelCase__							(				self							:							Any ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	List[Any]					=		''' \tHeLLo!how  \n Are yoU?  '''
       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		['''▁hello''', '''!''', '''how''', '''▁are''', '''▁you''', '''?''']
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	List[str]					=		DebertaVaTokenizer(_A     ,						do_lower_case=_A )
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Tuple					=		DebertaVaTokenizerFast(_A     ,						do_lower_case=_A )
       __SCREAMING_SNAKE_CASE      :	List[Any]					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )



     @unittest.skip('''There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.''' )
     def  UpperCAmelCase__							(				self							:							Any ):







       """simple docstring"""




       pass



     @unittest.skip('''There is an inconsistency between slow and fast tokenizer due to a bug in the fast one.''' )
     def  UpperCAmelCase__							(				self							:							Union[str, Any] ):







       """simple docstring"""




       pass



     def  UpperCAmelCase__							(				self							:							List[str] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		'''I was born in 92000, and this is falsé.'''
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	Any					=		DebertaVaTokenizer(_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Dict					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Tuple					=		DebertaVaTokenizerFast(_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Tuple					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Union[str, Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	str					=		'''I was born in 92000, and this is falsé.'''
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		['''▁i''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	List[str]					=		DebertaVaTokenizer(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	int					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )
       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	str					=		DebertaVaTokenizerFast(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	List[str]					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )
       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							List[Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Tuple					=		'''I was born in 92000, and this is falsé.'''
       __SCREAMING_SNAKE_CASE      :	List[str]					=		['''▁i''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''.''', ]
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		DebertaVaTokenizer(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		DebertaVaTokenizerFast(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	List[Any]					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Optional[int] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Any					=		'''I was born in 92000, and this is falsé.'''
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', '''▁''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''▁''', '''.''', ]
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		DebertaVaTokenizer(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		DebertaVaTokenizerFast(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Any					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Any ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		''' \tHeLLo!how  \n Are yoU?  '''
       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		['''▁''', '''<unk>''', '''e''', '''<unk>''', '''o''', '''!''', '''how''', '''▁''', '''<unk>''', '''re''', '''▁yo''', '''<unk>''', '''?''']
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	Tuple					=		DebertaVaTokenizer(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	Tuple					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Dict					=		DebertaVaTokenizerFast(_A     ,						do_lower_case=_A     ,						split_by_punct=_A )
       __SCREAMING_SNAKE_CASE      :	List[str]					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )

       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Union[str, Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		self.get_tokenizer()
       __SCREAMING_SNAKE_CASE      :	Any					=		self.get_rust_tokenizer()

       __SCREAMING_SNAKE_CASE      :	Dict					=		'''I was born in 92000, and this is falsé.'''

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		tokenizer.convert_ids_to_tokens(tokenizer.encode(_A     ,						add_special_tokens=_A ) )
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		rust_tokenizer.convert_ids_to_tokens(rust_tokenizer.encode(_A     ,						add_special_tokens=_A ) )
       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	str					=		tokenizer.encode(_A     ,						add_special_tokens=_A )
       __SCREAMING_SNAKE_CASE      :	List[Any]					=		rust_tokenizer.encode(_A     ,						add_special_tokens=_A )
       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		self.get_rust_tokenizer()
       __SCREAMING_SNAKE_CASE      :	Tuple					=		tokenizer.encode(_A )
       __SCREAMING_SNAKE_CASE      :	List[str]					=		rust_tokenizer.encode(_A )
       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Any ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Optional[int]					=		'''This is a test'''
       __SCREAMING_SNAKE_CASE      :	str					=		[13, 1, 4398, 25, 21, 1289]
       __SCREAMING_SNAKE_CASE      :	Any					=		['''▁''', '''T''', '''his''', '''▁is''', '''▁a''', '''▁test''']
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		['''▁''', '''<unk>''', '''his''', '''▁is''', '''▁a''', '''▁test''']

       __SCREAMING_SNAKE_CASE      :	List[str]					=		DebertaVaTokenizer(_A     ,						keep_accents=_A )
       __SCREAMING_SNAKE_CASE      :	Dict					=		DebertaVaTokenizerFast(_A     ,						keep_accents=_A )

       __SCREAMING_SNAKE_CASE      :	int					=		tokenizer.encode(_A     ,						add_special_tokens=_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Tuple					=		tokenizer.tokenize(_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		tokenizer.convert_ids_to_tokens(_A )
       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	str					=		rust_tokenizer.encode(_A     ,						add_special_tokens=_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Dict					=		rust_tokenizer.tokenize(_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Any					=		rust_tokenizer.convert_ids_to_tokens(_A )
       self.assertListEqual(_A     ,						_A )

       # fmt: off
       __SCREAMING_SNAKE_CASE      :	int					=		'''I was born in 92000, and this is falsé.'''
       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		[13, 1, 23, 386, 19, 561, 3050, 15, 17, 48, 25, 8256, 18, 1, 9]
       __SCREAMING_SNAKE_CASE      :	str					=		['''▁''', '''I''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''é''', '''.''', ]
       __SCREAMING_SNAKE_CASE      :	Tuple					=		['''▁''', '''<unk>''', '''▁was''', '''▁born''', '''▁in''', '''▁9''', '''2000''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁fal''', '''s''', '''<unk>''', '''.''', ]
       # fmt: on

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		tokenizer.encode(_A     ,						add_special_tokens=_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	List[str]					=		tokenizer.tokenize(_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	str					=		tokenizer.convert_ids_to_tokens(_A )
       self.assertListEqual(_A     ,						_A )

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		rust_tokenizer.encode(_A     ,						add_special_tokens=_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		rust_tokenizer.tokenize(_A )
       self.assertListEqual(_A     ,						_A )
       __SCREAMING_SNAKE_CASE      :	List[Any]					=		rust_tokenizer.convert_ids_to_tokens(_A )
       self.assertListEqual(_A     ,						_A )



     def  UpperCAmelCase__							(				self							:							Optional[Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Dict					=		DebertaVaTokenizer(_A )

       __SCREAMING_SNAKE_CASE      :	Union[str, Any]					=		tokenizer.encode('''sequence builders''' )
       __SCREAMING_SNAKE_CASE      :	Any					=		tokenizer.encode('''multi-sequence build''' )

       __SCREAMING_SNAKE_CASE      :	Tuple					=		tokenizer.build_inputs_with_special_tokens(_A )
       __SCREAMING_SNAKE_CASE      :	Optional[Any]					=		tokenizer.build_inputs_with_special_tokens(_A     ,						_A )

       self.assertEqual([tokenizer.cls_token_id] + text + [tokenizer.sep_token_id]     ,						_A )
       self.assertEqual(
           [tokenizer.cls_token_id] + text + [tokenizer.sep_token_id] + text_a + [tokenizer.sep_token_id]     ,						_A     ,						)




     @slow
     def  UpperCAmelCase__							(				self							:							Union[str, Any] ):







       """simple docstring"""




       __SCREAMING_SNAKE_CASE      :	Any					=		{'''input_ids''': [[1, 3_9867, 36, 1_9390, 486, 27, 3_5052, 8_1436, 18, 6_0685, 1225, 7, 3_5052, 8_1436, 18, 9367, 1_6899, 18, 1_5937, 53, 594, 773, 18, 1_6287, 3_0465, 36, 1_5937, 6, 4_1139, 38, 3_6979, 6_0763, 191, 6, 3_4132, 99, 6, 5_0538, 390, 4_3230, 6, 3_4132, 2779, 2_0850, 14, 699, 1072, 1194, 36, 382, 1_0901, 53, 7, 699, 1072, 2084, 36, 2_0422, 630, 53, 19, 105, 3049, 1896, 1053, 1_6899, 1506, 11, 3_7978, 4243, 7, 1237, 3_1869, 200, 1_6566, 654, 6, 3_5052, 8_1436, 7, 5_5630, 1_3593, 4, 2], [1, 26, 1_5011, 13, 667, 8, 1053, 18, 2_3611, 1237, 7_2356, 1_2820, 34, 10_4134, 1209, 35, 1_3313, 6627, 21, 202, 347, 7, 164, 2399, 11, 46, 4485, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 5, 1232, 2864, 1_5785, 1_4951, 105, 5, 8581, 1250, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], '''token_type_ids''': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], '''attention_mask''': [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}  # noqa: E501
       # fmt: on

       self.tokenizer_integration_test_util(
           expected_encoding=_A     ,						model_name='''microsoft/deberta-v2-xlarge'''     ,						revision='''ad6e42c1532ddf3a15c39246b63f5559d558b670'''     ,						)






import functools
import operator

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


__a							     =					logging.get_logger(__name__)

__a							     =					{
    'facebook/wav2vec2-base-960h': 'https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json',
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}

class     __a(	_a  ):






    """simple docstring"""





    lowerCAmelCase         = '''wav2vec2'''





    def __init__( self  ,_SCREAMING_SNAKE_CASE=32  ,_SCREAMING_SNAKE_CASE=768  ,_SCREAMING_SNAKE_CASE=12  ,_SCREAMING_SNAKE_CASE=12  ,_SCREAMING_SNAKE_CASE=3_072  ,_SCREAMING_SNAKE_CASE="gelu"  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=0.0  ,_SCREAMING_SNAKE_CASE=0.0  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=0.02  ,_SCREAMING_SNAKE_CASE=1e-5  ,_SCREAMING_SNAKE_CASE="group"  ,_SCREAMING_SNAKE_CASE="gelu"  ,_SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 512, 512, 512)  ,_SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)  ,_SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)  ,_SCREAMING_SNAKE_CASE=False  ,_SCREAMING_SNAKE_CASE=128  ,_SCREAMING_SNAKE_CASE=16  ,_SCREAMING_SNAKE_CASE=False  ,_SCREAMING_SNAKE_CASE=True  ,_SCREAMING_SNAKE_CASE=0.05  ,_SCREAMING_SNAKE_CASE=10  ,_SCREAMING_SNAKE_CASE=2  ,_SCREAMING_SNAKE_CASE=0.0  ,_SCREAMING_SNAKE_CASE=10  ,_SCREAMING_SNAKE_CASE=0  ,_SCREAMING_SNAKE_CASE=320  ,_SCREAMING_SNAKE_CASE=2  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE=100  ,_SCREAMING_SNAKE_CASE=256  ,_SCREAMING_SNAKE_CASE=256  ,_SCREAMING_SNAKE_CASE=0.1  ,_SCREAMING_SNAKE_CASE="sum"  ,_SCREAMING_SNAKE_CASE=False  ,_SCREAMING_SNAKE_CASE=False  ,_SCREAMING_SNAKE_CASE=256  ,_SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 1_500)  ,_SCREAMING_SNAKE_CASE=(5, 3, 3, 1, 1)  ,_SCREAMING_SNAKE_CASE=(1, 2, 3, 1, 1)  ,_SCREAMING_SNAKE_CASE=512  ,_SCREAMING_SNAKE_CASE=0  ,_SCREAMING_SNAKE_CASE=1  ,_SCREAMING_SNAKE_CASE=2  ,_SCREAMING_SNAKE_CASE=False  ,_SCREAMING_SNAKE_CASE=3  ,_SCREAMING_SNAKE_CASE=2  ,_SCREAMING_SNAKE_CASE=3  ,_SCREAMING_SNAKE_CASE=None  ,_SCREAMING_SNAKE_CASE=None  ,**_SCREAMING_SNAKE_CASE  ,)					->						Optional[int]:
         super().__init__(**_SCREAMING_SNAKE_CASE  ,pad_token_id=_SCREAMING_SNAKE_CASE  ,bos_token_id=_SCREAMING_SNAKE_CASE  ,eos_token_id=_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				int  =     hidden_size
         UpperCAmelCase_     :				Tuple  =     feat_extract_norm
         UpperCAmelCase_     :				List[Any]  =     feat_extract_activation
         UpperCAmelCase_     :				str  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				Any  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				Tuple  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				Dict  =     conv_bias
         UpperCAmelCase_     :				str  =     num_conv_pos_embeddings
         UpperCAmelCase_     :				Any  =     num_conv_pos_embedding_groups
         UpperCAmelCase_     :				Tuple  =     len(self.conv_dim    )
         UpperCAmelCase_     :				Union[str, Any]  =     num_hidden_layers
         UpperCAmelCase_     :				Dict  =     intermediate_size
         UpperCAmelCase_     :				Any  =     hidden_act
         UpperCAmelCase_     :				Any  =     num_attention_heads
         UpperCAmelCase_     :				str  =     hidden_dropout
         UpperCAmelCase_     :				int  =     attention_dropout
         UpperCAmelCase_     :				Tuple  =     activation_dropout
         UpperCAmelCase_     :				List[str]  =     feat_proj_dropout
         UpperCAmelCase_     :				int  =     final_dropout
         UpperCAmelCase_     :				Union[str, Any]  =     layerdrop
         UpperCAmelCase_     :				Optional[Any]  =     layer_norm_eps
         UpperCAmelCase_     :				str  =     initializer_range
         UpperCAmelCase_     :				List[str]  =     vocab_size
         UpperCAmelCase_     :				Optional[int]  =     do_stable_layer_norm
         UpperCAmelCase_     :				Optional[int]  =     use_weighted_layer_sum

         if (
             (len(self.conv_stride    ) != self.num_feat_extract_layers)
             or (len(self.conv_kernel    ) != self.num_feat_extract_layers)
             or (len(self.conv_dim    ) != self.num_feat_extract_layers)
         ):
              raise ValueError(
                  '''Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =='''
                  ''' `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ='''
                  f''' {len(self.conv_dim    )}`, `len(config.conv_stride) = {len(self.conv_stride    )}`,'''
                  f''' `len(config.conv_kernel) = {len(self.conv_kernel    )}`.'''    )

         # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
         UpperCAmelCase_     :				Optional[int]  =     apply_spec_augment
         UpperCAmelCase_     :				Tuple  =     mask_time_prob
         UpperCAmelCase_     :				Optional[Any]  =     mask_time_length
         UpperCAmelCase_     :				Union[str, Any]  =     mask_time_min_masks
         UpperCAmelCase_     :				Optional[Any]  =     mask_feature_prob
         UpperCAmelCase_     :				str  =     mask_feature_length
         UpperCAmelCase_     :				Dict  =     mask_feature_min_masks

         # parameters for pretraining with codevector quantized representations
         UpperCAmelCase_     :				Union[str, Any]  =     num_codevectors_per_group
         UpperCAmelCase_     :				Any  =     num_codevector_groups
         UpperCAmelCase_     :				Union[str, Any]  =     contrastive_logits_temperature
         UpperCAmelCase_     :				List[str]  =     feat_quantizer_dropout
         UpperCAmelCase_     :				Dict  =     num_negatives
         UpperCAmelCase_     :				List[str]  =     codevector_dim
         UpperCAmelCase_     :				List[str]  =     proj_codevector_dim
         UpperCAmelCase_     :				str  =     diversity_loss_weight

         # ctc loss
         UpperCAmelCase_     :				List[Any]  =     ctc_loss_reduction
         UpperCAmelCase_     :				List[str]  =     ctc_zero_infinity

         # adapter
         UpperCAmelCase_     :				Optional[Any]  =     add_adapter
         UpperCAmelCase_     :				Any  =     adapter_kernel_size
         UpperCAmelCase_     :				Optional[int]  =     adapter_stride
         UpperCAmelCase_     :				List[Any]  =     num_adapter_layers
         UpperCAmelCase_     :				Optional[Any]  =     output_hidden_size or hidden_size
         UpperCAmelCase_     :				Optional[int]  =     adapter_attn_dim

         # SequenceClassification-specific parameter. Feel free to ignore for other classes.
         UpperCAmelCase_     :				List[str]  =     classifier_proj_size

         # XVector-specific parameters. Feel free to ignore for other classes.
         UpperCAmelCase_     :				List[str]  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				int  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				Dict  =     list(_SCREAMING_SNAKE_CASE    )
         UpperCAmelCase_     :				Any  =     xvector_output_dim





    @property
    def 				a__ ( self    )					->						Any:
         return functools.reduce(operator.mul  ,self.conv_stride  ,1    )