From 48ab0963ae319266c58915f69070e1c1894affa3 Mon Sep 17 00:00:00 2001 From: Howard Su Date: Mon, 17 Apr 2023 23:07:30 +0800 Subject: [PATCH] No need to copy tokens --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index cdd8bd16b..16fb7d1eb 100644 --- a/llama.cpp +++ b/llama.cpp @@ -1066,7 +1066,7 @@ static bool llama_eval_internal( gf.n_threads = N >= 32 && ggml_cpu_has_blas() ? 1 : n_threads; struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N); - memcpy(embd->data, tokens, N*ggml_element_size(embd)); + embd->data = (void*)tokens; struct ggml_tensor * inpL = ggml_get_rows(ctx0, model.tok_embeddings, embd);