Skip to content

Commit

Permalink
Warn user if a context size greater than 2048 tokens is specified (gg…
Browse files Browse the repository at this point in the history
…erganov#274)

LLaMA doesn't support more than 2048 token context sizes, and going above that produces terrible results.
  • Loading branch information
Ronsor authored Mar 19, 2023
1 parent 6f61c18 commit d7def1a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,11 @@ int main(int argc, char ** argv) {
if (gpt_params_parse(argc, argv, params) == false) {
return 1;
}

if (params.n_ctx > 2048) {
fprintf(stderr, "%s: warning: model does not support context sizes greater than 2048 tokens (%d specified);"
"expect poor results\n", __func__, params.n_ctx);
}

if (params.seed < 0) {
params.seed = time(NULL);
Expand Down

0 comments on commit d7def1a

Please sign in to comment.