Skip to content

Commit 875c36e

Browse files
committed
fix tests
1 parent 2b69cc0 commit 875c36e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

tests/models/dac/test_feature_extraction_dac.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ def test_truncation_and_padding(self):
207207
# force no pad
208208
with self.assertRaisesRegex(
209209
ValueError,
210-
"^Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.$",
210+
r"Unable to convert output[\s\S]*padding=True",
211211
):
212212
truncated_outputs = feature_extractor(input_audio, padding=False, return_tensors="pt").input_values
213213

tests/models/dia/test_feature_extraction_dia.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def test_truncation_and_padding(self):
223223
# force no pad
224224
with self.assertRaisesRegex(
225225
ValueError,
226-
"^Unable to create tensor, you should probably activate padding with 'padding=True' to have batched tensors with the same length.$",
226+
r"Unable to convert output[\s\S]*padding=True",
227227
):
228228
truncated_outputs = feature_extractor(input_audio, padding=False, return_tensors="pt").input_values
229229

tests/models/encodec/test_feature_extraction_encodec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)