From 9acac86ec4a2973000d7f8320c034c7f9c9592b5 Mon Sep 17 00:00:00 2001 From: AlanConstantino Date: Thu, 29 Jan 2026 00:06:41 -0800 Subject: [PATCH] fix(coreml): remove broken --optimize-ane flag from generate script The --optimize-ane flag in convert-whisper-to-coreml.py is explicitly marked as 'currently broken' in its help text. When enabled, it produces CoreML models that load successfully but crash with SIGSEGV during inference. The ANE optimization code (WhisperANE classes) hasn't been maintained to work with: - Newer model architectures (e.g., large-v3-turbo with 128 mel bins) - Recent coremltools versions that generate iOS 18+ specific ops Removing this flag allows generate-coreml-model.sh to produce working CoreML models that run correctly on Apple Silicon via Metal/ANE without the broken optimization path. --- models/generate-coreml-model.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/models/generate-coreml-model.sh b/models/generate-coreml-model.sh index 1cb20f06..aaf00fcf 100755 --- a/models/generate-coreml-model.sh +++ b/models/generate-coreml-model.sh @@ -25,7 +25,10 @@ if [ "$mname" = "-h5" ]; then echo "$mpath" python3 models/convert-h5-to-coreml.py --model-name "$mname" --model-path "$mpath" --encoder-only True else - python3 models/convert-whisper-to-coreml.py --model "$mname" --encoder-only True --optimize-ane True + # Note: --optimize-ane is disabled as it produces models that crash during inference. + # The ANE optimization code needs maintenance to work with newer model architectures + # and coremltools versions. See convert-whisper-to-coreml.py for details. + python3 models/convert-whisper-to-coreml.py --model "$mname" --encoder-only True fi xcrun coremlc compile models/coreml-encoder-"${mname}".mlpackage models/