Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
David Rubinstein committed Oct 2, 2023
1 parent 101d78a commit 4443112
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
os:
- ubuntu-latest
- windows-latest
- macos-13
- macos-latest
py:
- "3.11"
- "3.10"
Expand Down
5 changes: 4 additions & 1 deletion basic_pitch/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@ 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:
return cast(ct.models.MLModel, self.model.predict({"input": x})) # type: ignore
print(f"isfinite: {np.all(np.isfinite(x))}", flush=True)
print(f"shape: {x.shape}", flush=True)
print(f"dtype: {x.dtype}", flush=True)
return cast(ct.models.MLModel, self.model).predict({"input": x}) # type: ignore
elif self.model_type == Model.MODEL_TYPES.TFLITE:
return self.model(input_2=x) # type: ignore
elif self.model_type == Model.MODEL_TYPES.ONNX:
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 --ignore tests/test_nn.py -s {posargs}
setenv =
SOURCE = {toxinidir}/basic_pitch
TEST_SOURCE = {toxinidir}/tests
Expand Down

0 comments on commit 4443112

Please sign in to comment.