From 76b05fc4a0052ac0b7202e002893d6cdd526daab Mon Sep 17 00:00:00 2001 From: Kerfuffle <44031344+KerfuffleV2@users.noreply.github.com> Date: Tue, 17 Oct 2023 12:13:46 -0600 Subject: [PATCH] Avoid a string copy Co-authored-by: Georgi Gerganov --- llama.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama.cpp b/llama.cpp index 5e18def98..bbe01a70b 100644 --- a/llama.cpp +++ b/llama.cpp @@ -2250,7 +2250,7 @@ static void llm_load_vocab( { LLM_KV_TOKENIZER_PAD_ID, vocab.special_pad_id }, }; for (const auto & it : special_token_types) { - const std::string key = kv(std::get<0>(it)); + const std::string & key = kv(std::get<0>(it)); int32_t & id = std::get<1>(it), old_id = id; GGUF_GET_KEY(ctx, id, gguf_get_val_u32, GGUF_TYPE_UINT32, false, key);