print error on insufficient batch size
This commit is contained in:
parent
208e1f03c3
commit
789a194da1
1 changed files with 3 additions and 1 deletions
|
@ -171,7 +171,9 @@ int main(int argc, char ** argv) {
|
|||
for (auto & chunk : chunks) {
|
||||
auto inp = ::llama_tokenize(ctx, chunk.textdata, true, false);
|
||||
if (inp.size() > n_batch) {
|
||||
inp.resize(n_batch);
|
||||
// error: chunk size exceeds batch size
|
||||
fprintf(stderr, "%s: error: chunk size (%zu) exceeds batch size (%zu), increase batch size and re-run\n",__func__, inp.size(), n_batch);
|
||||
return 1;
|
||||
}
|
||||
// add eos if not present
|
||||
if (inp.empty() || inp.back() != llama_token_eos(model)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue