From 0a3c582bb5c775d21a3f480eab3aba691628d5e0 Mon Sep 17 00:00:00 2001 From: David Rubinstein Date: Mon, 2 Oct 2023 15:23:21 -0400 Subject: [PATCH] More logging --- basic_pitch/inference.py | 1 + pyproject.toml | 4 ++-- tox.ini | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/basic_pitch/inference.py b/basic_pitch/inference.py index a89a4e15..ecd5cc3c 100644 --- a/basic_pitch/inference.py +++ b/basic_pitch/inference.py @@ -153,6 +153,7 @@ def predict(self, x: npt.NDArray[np.float32]) -> Dict[str, npt.NDArray[np.float3 if self.model_type == Model.MODEL_TYPES.TENSORFLOW: return {k: v.numpy() for k, v in cast(tf.keras.Model, self.model(x)).items()} elif self.model_type == Model.MODEL_TYPES.COREML: + print(f"isfinite: {np.all(np.isfinite(x))}") return cast(ct.models.MLModel, self.model.predict({"input": x.tolist()})) # type: ignore elif self.model_type == Model.MODEL_TYPES.TFLITE: return self.model(input_2=x) # type: ignore diff --git a/pyproject.toml b/pyproject.toml index 349fc9d8..90c0955b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ classifiers = [ "Programming Language :: Python :: Implementation :: CPython", ] dependencies = [ - "coremltools<7; platform_system == 'Darwin' and python_version < '3.11'", + "coremltools; platform_system == 'Darwin' and python_version < '3.11'", "librosa>=0.8.0", "mir_eval>=0.6", "numpy<1.24,>=1.18", @@ -58,7 +58,7 @@ tf = [ "tensorflow>=2.4.1; platform_system != 'Darwin'", "tensorflow-macos>=2.4.1; platform_system == 'Darwin' and python_version > '3.7'", ] -coreml = ["coremltools<7"] +coreml = ["coremltools"] onnx = ["onnxruntime"] docs = ["mkdocs>=1.0.4"] dev = [ diff --git a/tox.ini b/tox.ini index ed61e4ba..46010dab 100644 --- a/tox.ini +++ b/tox.ini @@ -7,7 +7,7 @@ usedevelop = True [testenv] deps = -e .[test] commands = - pytest tests --ignore tests/test_nn.py {posargs} + pytest tests -s --ignore tests/test_nn.py {posargs} setenv = SOURCE = {toxinidir}/basic_pitch TEST_SOURCE = {toxinidir}/tests