]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
coreml : always convert to "neuralnetwork" (#2770)
authormgrachten <redacted>
Mon, 3 Feb 2025 20:36:32 +0000 (21:36 +0100)
committerGitHub <redacted>
Mon, 3 Feb 2025 20:36:32 +0000 (22:36 +0200)
models/convert-whisper-to-coreml.py

index f66683e9b217ee2a6f470876a9085106e4266062..441efdd2d6fcc9f0bbe71bda1c01792222548052 100644 (file)
@@ -245,7 +245,7 @@ def convert_encoder(hparams, model, quantize=False):
 
     model = ct.convert(
         traced_model,
-        convert_to=None if quantize else "mlprogram", # convert will fail if weights are quantized, not sure why
+        convert_to="neuralnetwork",
         inputs=[ct.TensorType(name="logmel_data", shape=input_shape)],
         outputs=[ct.TensorType(name="output")],
         compute_units=ct.ComputeUnit.ALL
@@ -268,7 +268,7 @@ def convert_decoder(hparams, model, quantize=False):
 
     model = ct.convert(
         traced_model,
-        convert_to=None if quantize else "mlprogram", # convert will fail if weights are quantized, not sure why
+        convert_to="neuralnetwork",
         inputs=[
             ct.TensorType(name="token_data", shape=tokens_shape, dtype=int),
             ct.TensorType(name="audio_data", shape=audio_shape)