gguf : fix gguf_add_tensor name

This commit is contained in:
Georgi Gerganov 2023-08-27 21:21:44 +03:00
parent 34e5c9afe5
commit e23553c6c1
No known key found for this signature in database
GPG key ID: 449E073F9DC10735

2
ggml.c
View file

@ -20229,7 +20229,7 @@ void gguf_add_tensor(
const int idx = ctx->header.n_tensors;
ctx->infos = realloc(ctx->infos, (idx + 1)*sizeof(struct gguf_tensor_info));
ctx->infos[idx].name.n = strlen(tensor->name) + 1;
ctx->infos[idx].name.n = strlen(tensor->name);
ctx->infos[idx].name.data = strdup(tensor->name);
for (int i = 0; i < GGML_MAX_DIMS; ++i) {