diff --git a/mlx/io.h b/mlx/io.h index 640f62f68..e30c0de34 100644 --- a/mlx/io.h +++ b/mlx/io.h @@ -50,7 +50,7 @@ void save_safetensors( /** Load array map and metadata from .gguf file format */ -GGUFLoad load_gguf(std::string_view file, StreamOrDevice s = {}); +GGUFLoad load_gguf(const std::string& file, StreamOrDevice s = {}); void save_gguf( std::string file, diff --git a/mlx/io/gguf.cpp b/mlx/io/gguf.cpp index c81b39cd0..0193d2d09 100644 --- a/mlx/io/gguf.cpp +++ b/mlx/io/gguf.cpp @@ -231,7 +231,7 @@ std::unordered_map load_arrays(gguf_ctx* ctx) { return array_map; } -GGUFLoad load_gguf(std::string_view file, StreamOrDevice s) { +GGUFLoad load_gguf(const std::string& file, StreamOrDevice s) { gguf_ctx* ctx = gguf_open(file.data()); if (!ctx) { throw std::runtime_error("[load_gguf] gguf_init failed"); diff --git a/mlx/linalg.cpp b/mlx/linalg.cpp index 332f7088b..d772c0e14 100644 --- a/mlx/linalg.cpp +++ b/mlx/linalg.cpp @@ -96,7 +96,7 @@ inline array matrix_norm( inline array matrix_norm( const array& a, - std::string_view ord, + const std::string& ord, const std::vector& axis, bool keepdims, StreamOrDevice s) { @@ -153,7 +153,7 @@ array norm( array norm( const array& a, - std::string_view ord, + const std::string& ord, const std::optional>& axis /* = std::nullopt */, bool keepdims /* = false */, StreamOrDevice s /* = {} */) { diff --git a/mlx/linalg.h b/mlx/linalg.h index ca01aa730..aa46a7959 100644 --- a/mlx/linalg.h +++ b/mlx/linalg.h @@ -38,13 +38,13 @@ inline array norm( } array norm( const array& a, - std::string_view ord, + const std::string& ord, const std::optional>& axis = std::nullopt, bool keepdims = false, StreamOrDevice s = {}); inline array norm( const array& a, - std::string_view ord, + const std::string& ord, int axis, bool keepdims = false, StreamOrDevice s = {}) {