1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Copyright © 2023-2024 Apple Inc. */
#ifndef MLX_IOHELPERS_H
#define MLX_IOHELPERS_H
#include "mlx/c/map.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup mlx_ioutils IO objects
* MLX IO objects.
*/
/**@{*/
/**
* A MLX SafeTensors storage.
* Holds a string-to-array map (data) and string-to-string map (metadata).
*/
typedef struct mlx_safetensors_* mlx_safetensors;
/**
* Returns a empty safetensors storage.
*/
mlx_safetensors mlx_safetensors_new();
/**
* Returns the data map.
*/
mlx_map_string_to_array mlx_safetensors_data(mlx_safetensors st);
/**
* Returns the metadata map.
*/
mlx_map_string_to_string mlx_safetensors_metadata(mlx_safetensors st);
/**@}*/
#ifdef __cplusplus
}
#endif
#endif