From 460c48254098b28d422382a2bbff6a0b3d7f7e17 Mon Sep 17 00:00:00 2001 From: Matvey Soloviev Date: Mon, 13 Mar 2023 00:35:51 +0100 Subject: [PATCH] Fix token count accounting --- main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.cpp b/main.cpp index 387d35f..d1defe2 100644 --- a/main.cpp +++ b/main.cpp @@ -976,6 +976,8 @@ int main(int argc, char ** argv) { std::vector line_inp = ::llama_tokenize(vocab, buf, false); embd_inp.insert(embd_inp.end(), line_inp.begin(), line_inp.end()); + remaining_tokens -= line_inp.size(); + input_noecho = true; // do not echo this again }