iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📚

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.

https://huggingface.co/posts/pcuenq/949530140359936

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.

脚注
  1. MLX port of OpenELM https://github.com/apple/corenet/tree/main/mlx_examples/open_elm ↩︎

  2. Running Meta Llama 3 with MLX Swift https://zenn.dev/laiso/articles/808a2fa6c49a41 ↩︎

  3. OpenELM Core ML https://huggingface.co/collections/corenet-community/openelm-core-ml-6630c6b19268a5d878cfd194 ↩︎

Discussion