speculative : handle params.n_predict == -1

This commit is contained in:
Georgi Gerganov 2024-10-20 20:10:03 +03:00
parent 47bb241cb1
commit 67d18498d3
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

View File

@ -39,6 +39,11 @@ int main(int argc, char ** argv) {
return 1;
}
if (params.n_predict < -1) {
LOG_ERR("%s: --n-predict must be >= -1\n", __func__);
return 1;
}
common_init();
if (params.model_draft.empty()) {
@ -441,7 +446,7 @@ int main(int argc, char ** argv) {
++n_past_dft;
}
if (n_predict > params.n_predict || has_eos) {
if ((params.n_predict >= 0 && n_predict > params.n_predict) || has_eos) {
break;
}