gpt-2 : fix off-by-one error in batching logic

pull/12/head
Georgi Gerganov 2 years ago
parent 64efeceabd
commit 99f1afb613
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

@ -756,7 +756,7 @@ int main(int argc, char ** argv) {
// if here, it means we are still processing the input prompt
for (int k = i; k < embd_inp.size(); k++) {
embd.push_back(embd_inp[k]);
if (embd.size() > params.n_batch) {
if (embd.size() >= params.n_batch) {
break;
}
}

Loading…
Cancel
Save