





"""simple docstring"""





import itertools
import random
import unittest

import numpy as np

from transformers import EncodecFeatureExtractor
from transformers.testing_utils import require_torch
from transformers.utils.import_utils import is_torch_available

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


if is_torch_available():
    import torch


_lowerCamelCase  					=     random.Random()




def 		lowerCAmelCase_     (  lowercase_       :							List[str]			,				lowercase_       :							int=1.0			,				lowercase_       :							str=None			,				lowercase_       :							List[str]=None		):

 '''simple docstring'''






 if rng is None:
  __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	global_rng

 __SCREAMING_SNAKE_CASE			:      List[Any] 							=	[]
 for batch_idx in range(shape[0]		):
  values.append([]		)
  for _ in range(shape[1]		):
   values[-1].append(rng.random() * scale		)

 return values





@require_torch
class       snake_case		(       unittest.TestCase       ):

      def __init__(      self       :Any						,							_lowerCamelCase       :Optional[int]						,							_lowerCamelCase       :Union[str, Any]=7						,							_lowerCamelCase       :Any=4_0_0						,							_lowerCamelCase       :Optional[int]=2_0_0_0						,							_lowerCamelCase       :str=1						,							_lowerCamelCase       :Optional[Any]=0.0						,							_lowerCamelCase       :Union[str, Any]=2_4_0_0_0						,							_lowerCamelCase       :str=True						,							):
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	parent
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	batch_size
       __SCREAMING_SNAKE_CASE			:      Dict 							=	min_seq_length
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	max_seq_length
       __SCREAMING_SNAKE_CASE			:      str 							=	(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	feature_size
       __SCREAMING_SNAKE_CASE			:      Dict 							=	padding_value
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	sampling_rate
       __SCREAMING_SNAKE_CASE			:      Any 							=	return_attention_mask

      def 						SCREAMING_SNAKE_CASE_      (      self       :int						):
       return {
           "feature_size": self.feature_size,
           "padding_value": self.padding_value,
           "sampling_rate": self.sampling_rate,
           "return_attention_mask": self.return_attention_mask,
       }



      def 						SCREAMING_SNAKE_CASE_      (      self       :Union[str, Any]						,							_lowerCamelCase       :int=False						,							_lowerCamelCase       :List[Any]=False						):





       def _flatten(_lowerCamelCase       :int						):
        return list(itertools.chain(*_UpperCamelCase						)						)

       if equal_length:
        __SCREAMING_SNAKE_CASE			:      Any 							=	floats_list((self.batch_size, self.max_seq_length)						)
       else:
        # make sure that inputs increase in size
        __SCREAMING_SNAKE_CASE			:      Tuple 							=	[
            _flatten(floats_list((x, self.feature_size)						)						)
            for x in range(self.min_seq_length						,							self.max_seq_length						,							self.seq_length_diff						)
        ]

       if numpify:
        __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	[np.asarray(_UpperCamelCase						) for x in audio_inputs]

       return audio_inputs







@require_torch
class       snake_case		(       __lowerCamelCase			,					unittest.TestCase       ):
      lowerCamelCase__      =			EncodecFeatureExtractor

      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[Any]						):
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	EnCodecFeatureExtractionTester(self						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Dict						):
       __SCREAMING_SNAKE_CASE			:      Tuple 							=	self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()						)
       # create three inputs of length 800, 1000, and 1200
       __SCREAMING_SNAKE_CASE			:      int 							=	[floats_list((1, x)						)[0] for x in range(8_0_0						,							1_4_0_0						,							2_0_0						)]
       __SCREAMING_SNAKE_CASE			:      Tuple 							=	[np.asarray(_UpperCamelCase						) for audio_input in audio_inputs]

       # Test not batched input
       __SCREAMING_SNAKE_CASE			:      Tuple 							=	feat_extract(audio_inputs[0]						,							return_tensors='''np'''						).input_values
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	feat_extract(np_audio_inputs[0]						,							return_tensors='''np'''						).input_values
       self.assertTrue(np.allclose(_UpperCamelCase						,							_UpperCamelCase						,							atol=1e-3						)						)

       # Test batched
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	feat_extract(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''np'''						).input_values
       __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	feat_extract(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''np'''						).input_values
       for enc_seq_a, enc_seq_a in zip(_UpperCamelCase						,							_UpperCamelCase						):
        self.assertTrue(np.allclose(_UpperCamelCase						,							_UpperCamelCase						,							atol=1e-3						)						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Any						):
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()						)
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	np.random.rand(1_0_0						).astype(np.floataa						)
       __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	np_audio_inputs.tolist()

       for inputs in [py_audio_inputs, np_audio_inputs]:
        __SCREAMING_SNAKE_CASE			:      Any 							=	feature_extractor.pad([{'''input_values''': inputs}]						,							return_tensors='''np'''						)
        self.assertTrue(np_processed.input_values.dtype == np.floataa						)
        __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	feature_extractor.pad([{'''input_values''': inputs}]						,							return_tensors='''pt'''						)
        self.assertTrue(pt_processed.input_values.dtype == torch.floataa						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Tuple						,							_lowerCamelCase       :int						):
       from datasets import load_dataset

       __SCREAMING_SNAKE_CASE			:      Dict 							=	load_dataset('''hf-internal-testing/librispeech_asr_dummy'''						,							'''clean'''						,							split='''validation'''						)
       # automatic decoding with librispeech
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	ds.sort('''id'''						).select(range(_UpperCamelCase						)						)[:num_samples]['''audio''']

       return [x["array"] for x in audio_samples]

      def 						SCREAMING_SNAKE_CASE_      (      self       :List[str]						):
       __SCREAMING_SNAKE_CASE			:      int 							=	torch.tensor(
           [2.38_04e-03, 2.07_52e-03, 1.98_36e-03, 2.10_57e-03, 1.61_74e-03,
            3.05_18e-04, 9.15_53e-05, 3.35_69e-04, 9.76_56e-04, 1.83_11e-03,
            2.01_42e-03, 2.10_57e-03, 1.73_95e-03, 4.57_76e-04, -3.96_73e-04,
            4.57_76e-04, 1.00_71e-03, 9.15_53e-05, 4.88_28e-04, 1.15_97e-03,
            7.32_42e-04, 9.46_04e-04, 1.80_05e-03, 1.83_11e-03, 8.85_01e-04,
            4.27_25e-04, 4.88_28e-04, 7.32_42e-04, 1.09_86e-03, 2.10_57e-03]						)
       # fmt: on
       __SCREAMING_SNAKE_CASE			:      Dict 							=	self._load_datasamples(1						)
       __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	EncodecFeatureExtractor()
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	feature_extractor(_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(input_values.shape						,							(1, 1, 9_3_6_8_0)						)
       self.assertTrue(torch.allclose(input_values[0, 0, :3_0]						,							_UpperCamelCase						,							atol=1e-6						)						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[int]						):
       __SCREAMING_SNAKE_CASE			:      Any 							=	torch.tensor(
           [2.38_04e-03, 2.07_52e-03, 1.98_36e-03, 2.10_57e-03, 1.61_74e-03,
            3.05_18e-04, 9.15_53e-05, 3.35_69e-04, 9.76_56e-04, 1.83_11e-03,
            2.01_42e-03, 2.10_57e-03, 1.73_95e-03, 4.57_76e-04, -3.96_73e-04,
            4.57_76e-04, 1.00_71e-03, 9.15_53e-05, 4.88_28e-04, 1.15_97e-03,
            7.32_42e-04, 9.46_04e-04, 1.80_05e-03, 1.83_11e-03, 8.85_01e-04,
            4.27_25e-04, 4.88_28e-04, 7.32_42e-04, 1.09_86e-03, 2.10_57e-03]						)
       # fmt: on
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	self._load_datasamples(1						)
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	[np.tile(input_audio[0][None]						,							reps=(2, 1)						)]
       input_audio[0][1] *= 0.5
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	EncodecFeatureExtractor(feature_size=2						)
       __SCREAMING_SNAKE_CASE			:      int 							=	feature_extractor(_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(input_values.shape						,							(1, 2, 9_3_6_8_0)						)
       self.assertTrue(torch.allclose(input_values[0, 0, :3_0]						,							_UpperCamelCase						,							atol=1e-6						)						)
       self.assertTrue(torch.allclose(input_values[0, 1, :3_0]						,							EXPECTED_INPUT_VALUES * 0.5						,							atol=1e-6						)						)



      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[Any]						):
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	self._load_datasamples(2						)
       # would be easier if the stride was like
       __SCREAMING_SNAKE_CASE			:      str 							=	EncodecFeatureExtractor(feature_size=1						,							chunk_length_s=1						,							overlap=0.0_1						)

       # pad and trunc raise an error ?
       with self.assertRaisesRegex(
           _UpperCamelCase						,							'''^Both padding and truncation were set. Make sure you only set one.$'''						,							):
        __SCREAMING_SNAKE_CASE			:      Any 							=	feature_extractor(
            _UpperCamelCase						,							padding='''max_length'''						,							truncation=_UpperCamelCase						,							return_tensors='''pt'''						).input_values

       # truncate to chunk
       __SCREAMING_SNAKE_CASE			:      int 							=	feature_extractor(_UpperCamelCase						,							truncation=_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(2, 1, 7_1_5_2_0)						)  # 2 chunks

       # force truncate to max_length
       __SCREAMING_SNAKE_CASE			:      Dict 							=	feature_extractor(
           _UpperCamelCase						,							truncation=_UpperCamelCase						,							max_length=4_8_0_0_0						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(2, 1, 4_8_0_0_0)						)

       # pad to chunk
       __SCREAMING_SNAKE_CASE			:      Any 							=	feature_extractor(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(padded_outputs.shape						,							(2, 1, 9_5_2_8_0)						)

       # pad to chunk
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	feature_extractor(_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(2, 1, 9_5_2_8_0)						)

       # force pad to max length
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	feature_extractor(
           _UpperCamelCase						,							padding='''max_length'''						,							max_length=1_0_0_0_0_0						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(2, 1, 1_0_0_0_0_0)						)

       # force no pad
       with self.assertRaisesRegex(
           _UpperCamelCase						,							'''^Unable to create tensor, you should probably activate padding with \'padding=True\' to have batched tensors with the same length.$'''						,							):
        __SCREAMING_SNAKE_CASE			:      Any 							=	feature_extractor(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values

       __SCREAMING_SNAKE_CASE			:      List[str] 							=	feature_extractor(input_audio[0]						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(1, 1, 9_3_6_8_0)						)

       # no pad if no chunk_length_s
       __SCREAMING_SNAKE_CASE			:      Any 							=	None
       with self.assertRaisesRegex(
           _UpperCamelCase						,							'''^Unable to create tensor, you should probably activate padding with \'padding=True\' to have batched tensors with the same length.$'''						,							):
        __SCREAMING_SNAKE_CASE			:      List[Any] 							=	feature_extractor(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values

       __SCREAMING_SNAKE_CASE			:      Dict 							=	feature_extractor(input_audio[0]						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(1, 1, 9_3_6_8_0)						)

       # no pad if no overlap
       __SCREAMING_SNAKE_CASE			:      Any 							=	2
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	None
       with self.assertRaisesRegex(
           _UpperCamelCase						,							'''^Unable to create tensor, you should probably activate padding with \'padding=True\' to have batched tensors with the same length.$'''						,							):
        __SCREAMING_SNAKE_CASE			:      int 							=	feature_extractor(_UpperCamelCase						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values

       __SCREAMING_SNAKE_CASE			:      int 							=	feature_extractor(input_audio[0]						,							padding=_UpperCamelCase						,							return_tensors='''pt'''						).input_values
       self.assertEquals(truncated_outputs.shape						,							(1, 1, 9_3_6_8_0)						)








"""simple docstring"""





import json
import os
import shutil
import tempfile
import unittest

from transformers import is_speech_available, is_torch_available
from transformers.models.speechta import SpeechTaTokenizer
from transformers.testing_utils import get_tests_dir, require_torch
from transformers.utils import FEATURE_EXTRACTOR_NAME


if is_speech_available() and is_torch_available():
    from transformers import SpeechTaFeatureExtractor, SpeechTaProcessor

    from .test_feature_extraction_speechta import floats_list


_lowerCamelCase  					=     get_tests_dir('''fixtures/test_sentencepiece_bpe_char.model''')





@require_torch
class       snake_case		(       unittest.TestCase       ):

      def 						SCREAMING_SNAKE_CASE_      (      self       :Union[str, Any]						):
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	tempfile.mkdtemp()

       __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	SpeechTaTokenizer(_lowerCamelCase						)
       tokenizer.save_pretrained(self.tmpdirname						)

       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	{
           '''feature_size''': 1,
           '''padding_value''': 0.0,
           '''sampling_rate''': 1_6_0_0_0,
           '''do_normalize''': False,
           '''num_mel_bins''': 8_0,
           '''hop_length''': 1_6,
           '''win_length''': 6_4,
           '''win_function''': '''hann_window''',
           '''fmin''': 8_0,
           '''fmax''': 7_6_0_0,
           '''mel_floor''': 1e-10,
           '''reduction_factor''': 2,
           '''return_attention_mask''': True,
       }

       __SCREAMING_SNAKE_CASE			:      Any 							=	os.path.join(self.tmpdirname						,							_lowerCamelCase						)
       with open(self.feature_extraction_file						,							'''w'''						,							encoding='''utf-8'''						) as fp:
        fp.write(json.dumps(_lowerCamelCase						) + '''\n'''						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :str						,							**_lowerCamelCase       :str						):
       return SpeechTaTokenizer.from_pretrained(self.tmpdirname						,							**_lowerCamelCase						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Dict						,							**_lowerCamelCase       :Dict						):
       return SpeechTaFeatureExtractor.from_pretrained(self.tmpdirname						,							**_lowerCamelCase						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :List[str]						):
       shutil.rmtree(self.tmpdirname						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Union[str, Any]						):
       __SCREAMING_SNAKE_CASE			:      Any 							=	self.get_tokenizer()
       __SCREAMING_SNAKE_CASE			:      int 							=	self.get_feature_extractor()

       __SCREAMING_SNAKE_CASE			:      Any 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       processor.save_pretrained(self.tmpdirname						)
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	SpeechTaProcessor.from_pretrained(self.tmpdirname						)

       self.assertEqual(processor.tokenizer.get_vocab()						,							tokenizer.get_vocab()						)
       self.assertIsInstance(processor.tokenizer						,							_lowerCamelCase						)

       self.assertEqual(processor.feature_extractor.to_json_string()						,							feature_extractor.to_json_string()						)
       self.assertIsInstance(processor.feature_extractor						,							_lowerCamelCase						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Union[str, Any]						):
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	SpeechTaProcessor(tokenizer=self.get_tokenizer()						,							feature_extractor=self.get_feature_extractor()						)
       processor.save_pretrained(self.tmpdirname						)

       __SCREAMING_SNAKE_CASE			:      Tuple 							=	self.get_tokenizer(bos_token='''(BOS)'''						,							eos_token='''(EOS)'''						)
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	self.get_feature_extractor(do_normalize=_lowerCamelCase						,							padding_value=1.0						)

       __SCREAMING_SNAKE_CASE			:      Any 							=	SpeechTaProcessor.from_pretrained(
           self.tmpdirname						,							bos_token='''(BOS)'''						,							eos_token='''(EOS)'''						,							do_normalize=_lowerCamelCase						,							padding_value=1.0						)

       self.assertEqual(processor.tokenizer.get_vocab()						,							tokenizer_add_kwargs.get_vocab()						)
       self.assertIsInstance(processor.tokenizer						,							_lowerCamelCase						)

       self.assertEqual(processor.feature_extractor.to_json_string()						,							feature_extractor_add_kwargs.to_json_string()						)
       self.assertIsInstance(processor.feature_extractor						,							_lowerCamelCase						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :str						):
       __SCREAMING_SNAKE_CASE			:      Optional[int] 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      Tuple 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       __SCREAMING_SNAKE_CASE			:      int 							=	floats_list((3, 1_0_0_0)						)

       __SCREAMING_SNAKE_CASE			:      int 							=	feature_extractor(audio=_lowerCamelCase						,							return_tensors='''np'''						)
       __SCREAMING_SNAKE_CASE			:      List[str] 							=	processor(audio=_lowerCamelCase						,							return_tensors='''np'''						)

       for key in input_feat_extract.keys():
        self.assertAlmostEqual(input_feat_extract[key].sum()						,							input_processor[key].sum()						,							delta=1e-2						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Tuple						):
       __SCREAMING_SNAKE_CASE			:      Any 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      int 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      Any 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	floats_list((3, 1_0_0_0)						)

       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	feature_extractor(audio_target=_lowerCamelCase						,							return_tensors='''np'''						)
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	processor(audio_target=_lowerCamelCase						,							return_tensors='''np'''						)

       for key in input_feat_extract.keys():
        self.assertAlmostEqual(input_feat_extract[key].sum()						,							input_processor[key].sum()						,							delta=1e-2						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :List[Any]						):
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       __SCREAMING_SNAKE_CASE			:      int 							=	'''This is a test string'''

       __SCREAMING_SNAKE_CASE			:      str 							=	processor(text=_lowerCamelCase						)
       __SCREAMING_SNAKE_CASE			:      Union[str, Any] 							=	tokenizer(_lowerCamelCase						)

       for key in encoded_tok.keys():
        self.assertListEqual(encoded_tok[key]						,							encoded_processor[key]						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[int]						):
       __SCREAMING_SNAKE_CASE			:      int 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      str 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      Tuple 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       __SCREAMING_SNAKE_CASE			:      Dict 							=	'''This is a test string'''

       __SCREAMING_SNAKE_CASE			:      str 							=	processor(text_target=_lowerCamelCase						)
       __SCREAMING_SNAKE_CASE			:      Dict 							=	tokenizer(_lowerCamelCase						)

       for key in encoded_tok.keys():
        self.assertListEqual(encoded_tok[key]						,							encoded_processor[key]						)

      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[Any]						):
       __SCREAMING_SNAKE_CASE			:      Dict 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      Tuple 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]

       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	processor.batch_decode(_lowerCamelCase						)
       __SCREAMING_SNAKE_CASE			:      List[Any] 							=	tokenizer.batch_decode(_lowerCamelCase						)

       self.assertListEqual(_lowerCamelCase						,							_lowerCamelCase						)



      def 						SCREAMING_SNAKE_CASE_      (      self       :Optional[Any]						):
       __SCREAMING_SNAKE_CASE			:      Optional[Any] 							=	self.get_feature_extractor()
       __SCREAMING_SNAKE_CASE			:      str 							=	self.get_tokenizer()

       __SCREAMING_SNAKE_CASE			:      str 							=	SpeechTaProcessor(tokenizer=_lowerCamelCase						,							feature_extractor=_lowerCamelCase						)

       self.assertListEqual(
           processor.model_input_names						,							feature_extractor.model_input_names						,							msg='''`processor` and `feature_extractor` model input names do not match'''						,							)

