Skip to content

Commit c23a6d3

Browse files
authored
fix: specify test dependencies required for CI (#634)
1 parent e0c6ffe commit c23a6d3

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

requirements/test.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1+
av >=14.0.0
12
coverage ==7.8.*
23
cryptography==42.0.8
34
mosaicml-streaming==0.11.0
5+
torchaudio >=2.7.0
46
pytest ==8.4.*
57
pytest-cov ==6.1.1
68
pytest-timeout ==2.3.1
79
pytest-rerunfailures ==14.0
810
pytest-random-order ==1.1.1
911
pandas
12+
pyarrow >=20.0.0
13+
polars >1.0.0
1014
lightning
1115
transformers <4.53.0
1216
zstd
1317
numpy < 2.0
18+
s5cmd >=0.2.0
19+
soundfile >=0.13.0 # required for torchaudio backend

tests/processing/test_data_processor.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import random
44
import sys
55
from functools import partial
6+
from io import BytesIO
67
from queue import Empty
78
from typing import Any, List
89
from unittest import mock
@@ -1146,6 +1147,8 @@ def test_load_torch_audio(tmpdir, compression):
11461147

11471148
import torchaudio
11481149

1150+
torchaudio.set_audio_backend("soundfile")
1151+
11491152
optimize(
11501153
fn=create_synthetic_audio_bytes,
11511154
inputs=list(range(100)),
@@ -1157,9 +1160,11 @@ def test_load_torch_audio(tmpdir, compression):
11571160

11581161
dataset = StreamingDataset(input_dir=str(tmpdir))
11591162
sample = dataset[0]
1160-
tensor = torchaudio.load(sample["content"])
1161-
assert tensor[0].shape == torch.Size([1, 16000])
1162-
assert tensor[1] == 16000
1163+
buffer = BytesIO(sample["content"])
1164+
buffer.seek(0)
1165+
tensor, sample_rate = torchaudio.load(buffer, format="wav")
1166+
assert tensor.shape == torch.Size([1, 16000])
1167+
assert sample_rate == 16000
11631168

11641169

11651170
def create_synthetic_audio_file(filepath) -> dict:

0 commit comments

Comments
 (0)