set name of tensors with empty name from what was read from gguf

This commit is contained in:
xaedes 2023-08-28 15:27:26 +02:00
parent e86b3e3257
commit daa0b6c6a4
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

View file

@ -1529,6 +1529,10 @@ void read_tensor_by_name(struct ggml_tensor * dst, struct ggml_context * ctx, co
struct ggml_tensor * t = ggml_get_tensor(ctx, name);
GGML_ASSERT(are_same_layout(dst, t));
memcpy(dst->data, t->data, ggml_nbytes(t));
if (strlen(ggml_get_name(dst)) == 0) {
ggml_set_name(dst, name);
}
}
void load_opt_context_gguf(struct gguf_context * fctx, struct ggml_context * f_ggml_ctx, struct ggml_opt_context * opt) {