aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatvey Soloviev <blackhole89@gmail.com>2023-03-13 00:35:51 +0100
committerMatvey Soloviev <blackhole89@gmail.com>2023-03-13 01:04:41 +0100
commit460c48254098b28d422382a2bbff6a0b3d7f7e17 (patch)
tree16077961366ccca1cfb77083765bc4519b58a8dc
parentc80e2a8f2adeda202cbffe76ef800f134e51f03f (diff)
Fix token count accounting
-rw-r--r--main.cpp2
1 files changed, 2 insertions, 0 deletions
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<gpt_vocab::id> 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
}