Is it possible to port from .mlpackage to .mlmodelc
Hi, maybe I am not using the right tools to try porting this model to run locally on iOS/iPadOS, trying to port from ml package to ml modelc.
I'd tried to run xcrun coremlcompiler compile OpenELM-270M-128-float32.mlpackage . which returns an error -> "coremlcompiler: error: compiler error: Encountered an error while compiling a neural network model: Failed to set owner and group on copied weights during compilation. Error description: The file “weight.bin” doesn’t exist.",
I see the weights of the model in a different folder and not as a single .bin file as the compiler requires, any help with this regard would be much appreciated.
Thanks in advance.
Hello @0xjorgev ! How did you download the model? I'd suggest you make sure there are no symbolic links inside the downloaded bundle.
Having said that, adding the .mlpackage
to your Xcode project should work, there's usually no need to convert it to .mlmodelc
(Xcode will do it for you).
Pedro, thank you so much for your fast reply, I did download the models using the hugging face CLI tool but I'll try your suggestion, I was trying to mimic the structure in the SwiftChat app that looks for compiled models (also I did the same a few years ago with Stable Diffusion only got it working with the compiled versions).
Best regards.
Jorge.
Open the .mlpackage you downloaded, locate the weight.bin shortcut, right-click on it and select “Show Original.” Find the original file, copy it to the same directory as the weight.bin shortcut, and then delete the weight.bin shortcut. Rename the original file to weight.bin. Finally, import the .mlpackage into Xcode, and it should compile successfully.