@@ -333,7 +333,7 @@ def test_attention_mask_target(self):
333
333
feat_dict ["return_attention_mask" ] = True
334
334
feat_extract = self .feature_extraction_class (** feat_dict )
335
335
speech_inputs = self .feat_extract_tester .prepare_inputs_for_target ()
336
- input_lenghts = [len (x ) for x in speech_inputs ]
336
+ input_lengths = [len (x ) for x in speech_inputs ]
337
337
input_name = feat_extract .model_input_names [0 ]
338
338
339
339
processed = BatchFeature ({input_name : speech_inputs })
@@ -343,18 +343,18 @@ def test_attention_mask_target(self):
343
343
processed = feat_extract .pad (processed , padding = "longest" , return_tensors = "np" )
344
344
self .assertIn ("attention_mask" , processed )
345
345
self .assertListEqual (list (processed .attention_mask .shape ), list (processed [input_name ].shape [:2 ]))
346
- self .assertListEqual (processed .attention_mask .sum (- 1 ).tolist (), input_lenghts )
346
+ self .assertListEqual (processed .attention_mask .sum (- 1 ).tolist (), input_lengths )
347
347
348
348
def test_attention_mask_with_truncation_target (self ):
349
349
feat_dict = self .feat_extract_dict
350
350
feat_dict ["return_attention_mask" ] = True
351
351
feat_extract = self .feature_extraction_class (** feat_dict )
352
352
speech_inputs = self .feat_extract_tester .prepare_inputs_for_target ()
353
- input_lenghts = [len (x ) for x in speech_inputs ]
353
+ input_lengths = [len (x ) for x in speech_inputs ]
354
354
input_name = feat_extract .model_input_names [0 ]
355
355
356
356
processed = BatchFeature ({input_name : speech_inputs })
357
- max_length = min (input_lenghts )
357
+ max_length = min (input_lengths )
358
358
359
359
feat_extract .feature_size = feat_extract .num_mel_bins # hack!
360
360
@@ -393,7 +393,7 @@ def test_integration(self):
393
393
input_speech = self ._load_datasamples (1 )
394
394
feature_extractor = SpeechT5FeatureExtractor ()
395
395
input_values = feature_extractor (input_speech , return_tensors = "pd" ).input_values
396
- self .assertEquals (input_values .shape , [1 , 93680 ])
396
+ self .assertEqual (input_values .shape , [1 , 93680 ])
397
397
self .assertTrue (paddle .allclose (input_values [0 , :30 ], EXPECTED_INPUT_VALUES , atol = 1e-6 ))
398
398
399
399
def test_integration_target (self ):
@@ -409,5 +409,5 @@ def test_integration_target(self):
409
409
input_speech = self ._load_datasamples (1 )
410
410
feature_extractor = SpeechT5FeatureExtractor ()
411
411
input_values = feature_extractor (audio_target = input_speech , return_tensors = "pd" ).input_values
412
- self .assertEquals (input_values .shape , [1 , 366 , 80 ])
412
+ self .assertEqual (input_values .shape , [1 , 366 , 80 ])
413
413
self .assertTrue (paddle .allclose (input_values [0 , 0 , :30 ], EXPECTED_INPUT_VALUES , atol = 1e-4 ))
0 commit comments