From c494ed5b94b429d3d73721235e78c9f5fa6e5652 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sun, 19 Mar 2023 19:46:32 +0200 Subject: [PATCH] Fix off-by-one bug (#115) --- main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 2a07bbb40..e8e8df82d 100644 --- a/main.cpp +++ b/main.cpp @@ -977,7 +977,7 @@ int main(int argc, char ** argv) { last_n_tokens.erase(last_n_tokens.begin()); last_n_tokens.push_back(embd_inp[input_consumed]); ++input_consumed; - if ((int) embd.size() > params.n_batch) { + if ((int) embd.size() >= params.n_batch) { break; } }