From 2e197a1f21c7c9ae1707a10efce4fc748892d005 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 22 Nov 2024 16:11:25 +0200 Subject: [PATCH] make : build fixes --- Makefile | 1 + common/speculative.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5c8994385..dd6d864ad 100644 --- a/Makefile +++ b/Makefile @@ -966,6 +966,7 @@ OBJ_COMMON = \ $(DIR_COMMON)/console.o \ $(DIR_COMMON)/ngram-cache.o \ $(DIR_COMMON)/sampling.o \ + $(DIR_COMMON)/speculative.o \ $(DIR_COMMON)/build-info.o \ $(DIR_COMMON)/json-schema-to-grammar.o diff --git a/common/speculative.cpp b/common/speculative.cpp index eccba93e0..3adb9d67a 100644 --- a/common/speculative.cpp +++ b/common/speculative.cpp @@ -150,7 +150,7 @@ llama_tokens common_speculative_gen_draft( cur++; } - if ((cur >= params.n_reuse || prompt_tgt.size() <= n_ctx) && cur > reuse_n) { + if ((cur >= params.n_reuse || n_ctx >= (int) prompt_tgt.size()) && cur > reuse_n) { reuse_i = i; reuse_n = cur; } @@ -229,7 +229,7 @@ llama_tokens common_speculative_gen_draft( result.push_back(id); - if (result.size() >= params.n_draft) { + if (params.n_draft <= (int) result.size()) { break; }