diff --git a/pyproject.toml b/pyproject.toml index e23e7a04..24698370 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,10 +23,10 @@ dependencies = [ "numpy>=1.18", "onnxruntime; platform_system == 'Windows' and python_version < '3.11'", "pretty_midi>=0.2.9", - "resampy>=0.2.2", + "resampy>=0.2.2,<0.4.3", "scikit-learn", "scipy>=1.4.1", - "tensorflow>=2.4.1; platform_system != 'Darwin' and python_version >= '3.11'", + "tensorflow>=2.4.1,<2.16; platform_system != 'Darwin' and python_version >= '3.11'", "tensorflow-macos>=2.4.1; platform_system == 'Darwin' and python_version >= '3.11'", "tflite-runtime; platform_system == 'Linux' and python_version < '3.11'", "typing_extensions", @@ -56,8 +56,8 @@ test = [ "pytest-mock", ] tf = [ - "tensorflow>=2.4.1; platform_system != 'Darwin'", - "tensorflow-macos>=2.4.1; platform_system == 'Darwin' and python_version > '3.7'", + "tensorflow>=2.4.1,<2.16; platform_system != 'Darwin'", + "tensorflow-macos>=2.4.1,<2.16; platform_system == 'Darwin' and python_version > '3.7'", ] coreml = ["coremltools"] onnx = ["onnxruntime"] diff --git a/tests/resources/vocadito_10/model_output.npz b/tests/resources/vocadito_10/model_output.npz index 8719f8a8..9b2a4045 100644 Binary files a/tests/resources/vocadito_10/model_output.npz and b/tests/resources/vocadito_10/model_output.npz differ diff --git a/tests/resources/vocadito_10/note_events.npz b/tests/resources/vocadito_10/note_events.npz index ffd860c5..a5e7d51b 100644 Binary files a/tests/resources/vocadito_10/note_events.npz and b/tests/resources/vocadito_10/note_events.npz differ diff --git a/tests/test_inference.py b/tests/test_inference.py index 1934239e..89665855 100644 --- a/tests/test_inference.py +++ b/tests/test_inference.py @@ -55,12 +55,11 @@ def test_predict() -> None: assert all(note_pitch_max) assert isinstance(note_events, list) - expected_model_output = np.load("tests/resources/vocadito_10/model_output.npz") + expected_model_output = np.load("tests/resources/vocadito_10/model_output.npz", allow_pickle=True)["arr_0"].item() for k in expected_model_output.keys(): np.testing.assert_allclose(expected_model_output[k], model_output[k], atol=1e-4, rtol=0) - expected_note_events = np.load("tests/resources/vocadito_10/note_events.npz", allow_pickle=True) - expected_note_events = expected_note_events.get("arr_0") + expected_note_events = np.load("tests/resources/vocadito_10/note_events.npz", allow_pickle=True)["arr_0"] assert len(expected_note_events) == len(note_events) for expected, calculated in zip(expected_note_events, note_events): diff --git a/tox.ini b/tox.ini index 24a1df56..38a93806 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ requires = [testenv] deps = -e .[test] commands = - pytest tests --ignore tests/test_nn.py -s {posargs} + pytest tests --ignore tests/test_nn.py {posargs} setenv = SOURCE = {toxinidir}/basic_pitch TEST_SOURCE = {toxinidir}/tests