Skip to content

muna-ai/onnx2mlx

Repository files navigation

onnx2mlx

Muna logo

Convert ONNX models into MLX callables for accelerating inference on Apple Silicon.

Setup Instructions

Open a terminal and run the following command:

# Install onnx2mlx
$ pip install --upgrade onnx2mlx

Converting from ONNX to MLX

Use the onnx2mlx function to create a callable that uses MLX to run the model:

import mlx.core as mx
import onnx
from onnx2mlx import onnx2mlx

# Load an ONNX model
model = onnx.load("model.onnx")

# Convert to MLX
model_mlx = onnx2mlx(onnx_model)

# Run the MLX model
outputs = model_mlx(mx.array(...))

Useful Links

About

Convert ONNX models into MLX for inference on Apple Silicon.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages