use string (#976)

This commit is contained in:
Awni Hannun 2024-04-09 11:22:00 -07:00 committed by GitHub
parent b63ef10a7f
commit ae812350f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 6 deletions

View File

@ -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,

View 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");

View File

@ -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 /* = {} */) {

View File

@ -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 = {}) {