@@ -221,7 +221,7 @@ def test_truncation_and_padding(self):
221221 # force no pad
222222 with self .assertRaisesRegex (
223223 ValueError ,
224- "^ Unable to create tensor, you should probably activate padding with 'padding =True' to have batched tensors with the same length.$ " ,
224+ r" Unable to convert output[\s\S]* padding=True" ,
225225 ):
226226 truncated_outputs = feature_extractor (input_audio , padding = False , return_tensors = "pt" ).input_values
227227
@@ -232,7 +232,7 @@ def test_truncation_and_padding(self):
232232 feature_extractor .chunk_length_s = None
233233 with self .assertRaisesRegex (
234234 ValueError ,
235- "^ Unable to create tensor, you should probably activate padding with 'padding =True' to have batched tensors with the same length.$ " ,
235+ r" Unable to convert output[\s\S]* padding=True" ,
236236 ):
237237 truncated_outputs = feature_extractor (input_audio , padding = False , return_tensors = "pt" ).input_values
238238
@@ -244,7 +244,7 @@ def test_truncation_and_padding(self):
244244 feature_extractor .overlap = None
245245 with self .assertRaisesRegex (
246246 ValueError ,
247- "^ Unable to create tensor, you should probably activate padding with 'padding =True' to have batched tensors with the same length.$ " ,
247+ r" Unable to convert output[\s\S]* padding=True" ,
248248 ):
249249 truncated_outputs = feature_extractor (input_audio , padding = False , return_tensors = "pt" ).input_values
250250
0 commit comments