Skip to content

Commit

Permalink
More logging
Browse files Browse the repository at this point in the history
  • Loading branch information
David Rubinstein committed Oct 2, 2023
1 parent 8fdd36b commit 0a3c582
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions basic_pitch/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = [
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0a3c582

Please sign in to comment.