mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-24 17:31:16 +08:00
use string (#976)
This commit is contained in:
parent
b63ef10a7f
commit
ae812350f9
2
mlx/io.h
2
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,
|
||||
|
@ -231,7 +231,7 @@ std::unordered_map<std::string, array> 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");
|
||||
|
@ -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<int>& 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<std::vector<int>>& axis /* = std::nullopt */,
|
||||
bool keepdims /* = false */,
|
||||
StreamOrDevice s /* = {} */) {
|
||||
|
@ -38,13 +38,13 @@ inline array norm(
|
||||
}
|
||||
array norm(
|
||||
const array& a,
|
||||
std::string_view ord,
|
||||
const std::string& ord,
|
||||
const std::optional<std::vector<int>>& 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 = {}) {
|
||||
|
Loading…
Reference in New Issue
Block a user