MLX
 
Loading...
Searching...
No Matches
io.h File Reference
#include <unordered_map>
#include <variant>
#include "mlx/array.h"
#include "mlx/io/load.h"
#include "mlx/stream.h"
#include "mlx/utils.h"

Go to the source code of this file.

Namespaces

namespace  mlx
 
namespace  mlx::core
 

Typedefs

using mlx::core::GGUFMetaData
 
using mlx::core::GGUFLoad
 
using mlx::core::SafetensorsLoad
 

Functions

void mlx::core::save (std::shared_ptr< io::Writer > out_stream, array a)
 Save array to out stream in .npy format.
 
void mlx::core::save (std::string file, array a)
 Save array to file in .npy format.
 
array mlx::core::load (std::shared_ptr< io::Reader > in_stream, StreamOrDevice s={})
 Load array from reader in .npy format.
 
array mlx::core::load (std::string file, StreamOrDevice s={})
 Load array from file in .npy format.
 
SafetensorsLoad mlx::core::load_safetensors (std::shared_ptr< io::Reader > in_stream, StreamOrDevice s={})
 Load array map from .safetensors file format.
 
SafetensorsLoad mlx::core::load_safetensors (const std::string &file, StreamOrDevice s={})
 
void mlx::core::save_safetensors (std::shared_ptr< io::Writer > in_stream, std::unordered_map< std::string, array >, std::unordered_map< std::string, std::string > metadata={})
 
void mlx::core::save_safetensors (std::string file, std::unordered_map< std::string, array >, std::unordered_map< std::string, std::string > metadata={})
 
GGUFLoad mlx::core::load_gguf (const std::string &file, StreamOrDevice s={})
 Load array map and metadata from .gguf file format.
 
void mlx::core::save_gguf (std::string file, std::unordered_map< std::string, array > array_map, std::unordered_map< std::string, GGUFMetaData > meta_data={})