Skip to contents

Load MLX arrays from the safetensors format

Usage

mlx_load_safetensors(file, device = mlx_default_device())

Arguments

file

Path to a .npy file. The extension is appended automatically when missing.

device

Execution target: supply "gpu", "cpu", or an mlx_stream created via mlx_new_stream(). Default: mlx_default_device().

Value

A list containing:

tensors

Named list of mlx arrays.

metadata

Named character vector with the serialized metadata.