From daa0b6c6a4af4ec97a2ad317c97249ff7e5295fa Mon Sep 17 00:00:00 2001 From: xaedes Date: Mon, 28 Aug 2023 15:27:26 +0200 Subject: [PATCH] set name of tensors with empty name from what was read from gguf --- examples/train-text-from-scratch/train-text-from-scratch.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/train-text-from-scratch/train-text-from-scratch.cpp b/examples/train-text-from-scratch/train-text-from-scratch.cpp index a18f8f828..6d25edd78 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -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) {