From 1f83343498e7630cec9ddaf2cea5fc3352233c28 Mon Sep 17 00:00:00 2001 From: xaedes Date: Mon, 28 Aug 2023 02:02:05 +0200 Subject: [PATCH] bug fix in read_tensor_by_name --- examples/train-text-from-scratch/train-text-from-scratch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 18683f18f..4f0abca5a 100644 --- a/examples/train-text-from-scratch/train-text-from-scratch.cpp +++ b/examples/train-text-from-scratch/train-text-from-scratch.cpp @@ -1526,7 +1526,7 @@ void read_tensor_by_name(struct ggml_tensor * dst, struct ggml_context * ctx, co if (dst == NULL) { return; } - struct ggml_tensor * t = ggml_get_tensor(ctx, LLM_TENSOR_OPTIMIZER_ADAM_FIRST_MOMENTS); + struct ggml_tensor * t = ggml_get_tensor(ctx, name); GGML_ASSERT(are_same_layout(dst, t)); memcpy(dst->data, t->data, ggml_nbytes(t)); }