On Apple Silicon (linux/arm64) the built image never starts. Shimmy waits 15 s for the worker, the worker exits 1, and the container dies.
NameError: name '_default_model_type' is not defined
File "/app/.venv/lib/python3.11/site-packages/basic_pitch/__init__.py", line 95
Cause: basic-pitch picks a backend at import and finds none. poetry.lock pins tensorflow for Linux, but the aarch64 tensorflow wheel on PyPI is an empty shim that requires tensorflow-cpu-aws, which Poetry never resolved into the lock. Importing tensorflow inside the arm64 container raises ModuleNotFoundError.
CI and the AWS build are x86_64, so they get the real wheel and pass. This only bites local development on arm64 machines.
Fix: add the onnx extra to basic-pitch in pyproject.toml:
basic-pitch = { version = "^0.4.0", extras = ["onnx"] }
onnxruntime has aarch64 wheels and is far smaller than TensorFlow, so this also shrinks the image. Verified locally: with onnxruntime installed the worker imports in 1.0 s and transcription works.
On Apple Silicon (
linux/arm64) the built image never starts. Shimmy waits 15 s for the worker, the worker exits 1, and the container dies.Cause: basic-pitch picks a backend at import and finds none.
poetry.lockpinstensorflowfor Linux, but the aarch64tensorflowwheel on PyPI is an empty shim that requirestensorflow-cpu-aws, which Poetry never resolved into the lock. Importingtensorflowinside the arm64 container raisesModuleNotFoundError.CI and the AWS build are x86_64, so they get the real wheel and pass. This only bites local development on arm64 machines.
Fix: add the
onnxextra to basic-pitch inpyproject.toml:onnxruntimehas aarch64 wheels and is far smaller than TensorFlow, so this also shrinks the image. Verified locally: withonnxruntimeinstalled the worker imports in 1.0 s and transcription works.