iTranslated by AI
Running Apple OpenELM on iPhone
For apple/OpenELM released on Hugging Face, when evaluating on Mac or Linux, you can perform inference using models converted from apple/corenet weights to transformers or MLX via Python[1]. However, to run it on an actual iPhone, adjustments were required to load it from MLX Swift[2].
Recently, however, models already converted to CoreML format have been released on corenet-community on Hugging Face[3], so you can now easily try them out by including them in the builds of swift-transformers or huggingface/swift-chat.
git clone https://huggingface.co/corenet-community/coreml-OpenELM-270M
git clone https://github.com/huggingface/swift-chat
After launching swift-chat, transfer the mlpackage file (OpenELM-270M-128-float32.mlpackage) to the device.
You can transfer it via drag-and-drop for the simulator, or via AirDrop for actual devices.
Configure and load this model from within the swift-chat app.


Note: English is fine, but when I sent Japanese, it stopped responding.
-
MLX port of OpenELM https://github.com/apple/corenet/tree/main/mlx_examples/open_elm ↩︎
-
Running Meta Llama 3 with MLX Swift https://zenn.dev/laiso/articles/808a2fa6c49a41 ↩︎
-
OpenELM Core ML https://huggingface.co/collections/corenet-community/openelm-core-ml-6630c6b19268a5d878cfd194 ↩︎
Discussion