Skip to content

Commit 460c482

Browse files
committed
Fix token count accounting
1 parent c80e2a8 commit 460c482

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

main.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -976,6 +976,8 @@ int main(int argc, char ** argv) {
976976
std::vector<gpt_vocab::id> line_inp = ::llama_tokenize(vocab, buf, false);
977977
embd_inp.insert(embd_inp.end(), line_inp.begin(), line_inp.end());
978978

979+
remaining_tokens -= line_inp.size();
980+
979981
input_noecho = true; // do not echo this again
980982
}
981983

0 commit comments

Comments
 (0)