mlx.core.save_safetensors#

mlx.core.save_safetensors(file: str, arrays: Dict[str, array], metadata: Optional[Dict[str, str]] = None)#

Save array(s) to a binary file in .safetensors format.

See the Safetensors documentation for more information on the format.

Parameters:
  • file (file, str) – File in which the array is saved.

  • arrays (dict(str, array)) – The dictionary of names to arrays to be saved.

  • metadata (dict(str, str), optional) – The dictionary of metadata to be saved.